home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1995-04-19 | 14.1 KB | [TEXT/MMCC] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Wed Apr 19 16:20:27 1995, modified Wed Apr 19 16:20:27 1995, creator 'MMCC', type ASCII, 13212 bytes "PaperJugglingApp.c" , at 0x341c 994 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MMCC] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 50 61 70 65 72 4a | 75 67 67 6c 69 6e 67 41 |..PaperJ|ugglingA|
|00000010| 70 70 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |pp.c....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 01 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 33 9c 00 | 00 03 e2 ab bb 21 0b ab |.....3..|.....!..|
|00000060| bb 21 0b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.!......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 72 8f 00 00 |........|....r...|
|00000080| 2f 2f 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |//------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 0d | 2f 2f 2d 2d 2d 2d 2d 2d |-------.|//------|
|000000d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000100| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|00000110| 2f 2f 0d 2f 2f 09 48 6f | 72 72 69 62 6c 65 20 52 |//.//.Ho|rrible R|
|00000120| 69 63 6b 65 74 79 20 53 | 68 65 6c 6c 2c 20 62 79 |ickety S|hell, by|
|00000130| 20 44 61 76 65 20 4a 6f | 68 6e 73 6f 6e 0d 2f 2f | Dave Jo|hnson.//|
|00000140| 0d 2f 2f 09 a9 20 43 6f | 70 79 72 69 67 68 74 20 |.//.. Co|pyright |
|00000150| 31 39 38 35 20 2d 20 31 | 39 39 35 20 41 6e 79 6f |1985 - 1|995 Anyo|
|00000160| 6e 65 20 57 68 6f 20 57 | 61 6e 74 73 20 49 74 2c |ne Who W|ants It,|
|00000170| 0d 2f 2f 09 41 6c 6c 20 | 52 69 67 68 74 73 20 45 |.//.All |Rights E|
|00000180| 6e 65 72 67 65 74 69 63 | 61 6c 6c 79 20 48 75 72 |nergetic|ally Hur|
|00000190| 6c 65 64 20 61 73 20 66 | 61 72 20 61 77 61 79 20 |led as f|ar away |
|000001a0| 66 72 6f 6d 20 6d 65 20 | 61 73 20 70 6f 73 73 69 |from me |as possi|
|000001b0| 62 6c 65 2e 0d 2f 2f 09 | 55 73 65 20 61 74 20 79 |ble..//.|Use at y|
|000001c0| 6f 75 72 20 6f 77 6e 20 | 28 63 6f 6e 73 69 64 65 |our own |(conside|
|000001d0| 72 61 62 6c 65 29 20 72 | 69 73 6b 2e 0d 0d 0d 23 |rable) r|isk....#|
|000001e0| 69 6e 63 6c 75 64 65 09 | 22 50 61 70 65 72 4a 75 |include.|"PaperJu|
|000001f0| 67 67 6c 69 6e 67 2e 68 | 22 0d 23 69 6e 63 6c 75 |ggling.h|".#inclu|
|00000200| 64 65 09 3c 46 6f 6c 64 | 65 72 73 2e 68 3e 0d 23 |de.<Fold|ers.h>.#|
|00000210| 69 6e 63 6c 75 64 65 09 | 3c 53 63 72 61 70 2e 68 |include.|<Scrap.h|
|00000220| 3e 0d 0d 2f 2f 20 54 68 | 65 20 73 68 65 6c 6c 20 |>..// Th|e shell |
|00000230| 67 6c 6f 62 61 6c 73 20 | 77 65 20 6e 65 65 64 0d |globals |we need.|
|00000240| 65 78 74 65 72 6e 20 4d | 65 6e 75 48 61 6e 64 6c |extern M|enuHandl|
|00000250| 65 09 67 53 68 65 6c 6c | 4d 65 6e 75 48 61 6e 64 |e.gShell|MenuHand|
|00000260| 6c 65 73 5b 5d 3b 0d 65 | 78 74 65 72 6e 20 73 68 |les[];.e|xtern sh|
|00000270| 6f 72 74 09 09 67 44 6f | 63 54 69 74 6c 65 48 65 |ort..gDo|cTitleHe|
|00000280| 69 67 68 74 2c 20 67 44 | 6f 63 46 72 61 6d 65 57 |ight, gD|ocFrameW|
|00000290| 69 64 74 68 3b 0d 0d 2f | 2f 20 41 70 70 20 47 6c |idth;../|/ App Gl|
|000002a0| 6f 62 61 6c 73 0d 4d 65 | 6e 75 48 61 6e 64 6c 65 |obals.Me|nuHandle|
|000002b0| 09 09 09 67 41 70 70 4d | 65 6e 75 48 61 6e 64 6c |...gAppM|enuHandl|
|000002c0| 65 73 5b 6b 4e 75 6d 41 | 70 70 4d 65 6e 75 73 5d |es[kNumA|ppMenus]|
|000002d0| 3b 20 09 2f 2f 20 20 54 | 68 65 20 6d 65 6e 75 73 |; .// T|he menus|
|000002e0| 20 77 65 20 61 64 64 20 | 74 6f 20 74 68 65 20 73 | we add |to the s|
|000002f0| 68 65 6c 6c 20 0d 0d 2f | 2f 20 47 58 20 67 6c 6f |hell ../|/ GX glo|
|00000300| 62 61 6c 73 0d 42 6f 6f | 6c 65 61 6e 09 09 09 09 |bals.Boo|lean....|
|00000310| 67 44 65 62 75 67 67 69 | 6e 67 20 3d 20 74 72 75 |gDebuggi|ng = tru|
|00000320| 65 3b 09 09 09 2f 2f 20 | 49 66 20 67 44 65 62 75 |e;...// |If gDebu|
|00000330| 67 67 69 6e 67 20 3d 20 | 54 52 55 45 2c 20 65 72 |gging = |TRUE, er|
|00000340| 72 6f 72 73 20 61 6e 64 | 20 6e 6f 74 69 63 65 73 |rors and| notices|
|00000350| 20 77 69 6c 6c 20 62 65 | 20 70 6f 73 74 65 64 2e | will be| posted.|
|00000360| 0d 42 6f 6f 6c 65 61 6e | 09 09 09 09 67 47 69 76 |.Boolean|....gGiv|
|00000370| 65 4d 65 56 61 6c 69 64 | 61 74 69 6f 6e 20 3d 20 |eMeValid|ation = |
|00000380| 74 72 75 65 3b 09 2f 2f | 20 69 66 20 67 47 69 76 |true;.//| if gGiv|
|00000390| 65 4d 65 56 61 6c 69 64 | 61 74 69 6f 6e 20 3d 20 |eMeValid|ation = |
|000003a0| 54 52 55 45 2c 20 72 75 | 6e 2d 74 69 6d 65 20 76 |TRUE, ru|n-time v|
|000003b0| 61 6c 69 64 61 74 69 6f | 6e 20 6f 63 63 75 72 73 |alidatio|n occurs|
|000003c0| 2e 0d 6c 6f 6e 67 09 09 | 09 09 67 47 72 61 70 68 |..long..|..gGraph|
|000003d0| 69 63 73 48 65 61 70 53 | 69 7a 65 20 3d 20 36 30 |icsHeapS|ize = 60|
|000003e0| 30 3b 09 2f 2f 20 70 72 | 65 74 74 79 20 62 69 67 |0;.// pr|etty big|
|000003f0| 0d 47 58 50 72 69 6e 74 | 69 6e 67 45 76 65 6e 74 |.GXPrint|ingEvent|
|00000400| 55 50 50 09 67 4f 75 72 | 50 72 69 6e 74 69 6e 67 |UPP.gOur|Printing|
|00000410| 4f 76 65 72 72 69 64 65 | 55 50 50 3b 0d 67 78 47 |Override|UPP;.gxG|
|00000420| 72 61 70 68 69 63 73 43 | 6c 69 65 6e 74 09 67 47 |raphicsC|lient.gG|
|00000430| 72 61 70 68 69 63 73 43 | 6c 69 65 6e 74 3b 0d 0d |raphicsC|lient;..|
|00000440| 2f 2f 20 20 43 61 6c 6c | 65 64 20 62 79 20 74 68 |// Call|ed by th|
|00000450| 65 20 53 68 65 6c 6c 20 | 61 74 20 73 74 61 72 74 |e Shell |at start|
|00000460| 75 70 20 74 69 6d 65 20 | 0d 42 6f 6f 6c 65 61 6e |up time |.Boolean|
|00000470| 20 41 70 70 49 6e 69 74 | 28 76 6f 69 64 29 0d 7b | AppInit|(void).{|
|00000480| 0d 09 4d 65 6e 75 48 61 | 6e 64 6c 65 09 09 6d 68 |..MenuHa|ndle..mh|
|00000490| 6e 64 6c 3b 0d 09 0d 09 | 2f 2f 20 20 41 64 64 20 |ndl;....|// Add |
|000004a0| 74 68 65 20 22 4a 75 67 | 67 6c 65 22 20 6d 65 6e |the "Jug|gle" men|
|000004b0| 75 20 0d 09 6d 68 6e 64 | 6c 20 3d 20 47 65 74 4d |u ..mhnd|l = GetM|
|000004c0| 65 6e 75 28 6b 4a 75 67 | 67 6c 65 4d 65 6e 75 49 |enu(kJug|gleMenuI|
|000004d0| 44 29 3b 0d 09 69 66 28 | 6d 68 6e 64 6c 20 3d 3d |D);..if(|mhndl ==|
|000004e0| 20 6e 69 6c 29 0d 09 7b | 0d 09 09 44 6f 45 72 72 | nil)..{|...DoErr|
|000004f0| 6f 72 41 6c 65 72 74 28 | 6b 4e 6f 52 65 73 53 74 |orAlert(|kNoResSt|
|00000500| 72 2c 20 30 29 3b 0d 09 | 09 72 65 74 75 72 6e 20 |r, 0);..|.return |
|00000510| 66 61 6c 73 65 3b 0d 09 | 7d 0d 09 28 2a 6d 68 6e |false;..|}..(*mhn|
|00000520| 64 6c 29 2d 3e 6d 65 6e | 75 49 44 20 3d 20 6b 4a |dl)->men|uID = kJ|
|00000530| 75 67 67 6c 65 4d 65 6e | 75 49 44 3b 0d 09 49 6e |uggleMen|uID;..In|
|00000540| 73 65 72 74 4d 65 6e 75 | 28 6d 68 6e 64 6c 2c 20 |sertMenu|(mhndl, |
|00000550| 30 29 3b 0d 09 44 69 73 | 61 62 6c 65 49 74 65 6d |0);..Dis|ableItem|
|00000560| 28 6d 68 6e 64 6c 2c 20 | 30 29 3b 20 2f 2f 20 20 |(mhndl, |0); // |
|00000570| 44 69 73 61 62 6c 65 20 | 74 68 65 20 6d 65 6e 75 |Disable |the menu|
|00000580| 20 75 6e 74 69 6c 20 75 | 73 65 72 20 6f 70 65 6e | until u|ser open|
|00000590| 73 20 61 20 66 69 6c 65 | 20 0d 09 67 41 70 70 4d |s a file| ..gAppM|
|000005a0| 65 6e 75 48 61 6e 64 6c | 65 73 5b 6b 4a 75 67 67 |enuHandl|es[kJugg|
|000005b0| 6c 65 4d 65 6e 75 5d 20 | 3d 20 6d 68 6e 64 6c 3b |leMenu] |= mhndl;|
|000005c0| 0d 09 09 0d 09 44 72 61 | 77 4d 65 6e 75 42 61 72 |.....Dra|wMenuBar|
|000005d0| 28 29 3b 0d 09 0d 09 2f | 2f 20 49 6e 69 74 69 61 |();..../|/ Initia|
|000005e0| 6c 69 7a 65 20 67 6c 6f | 62 61 6c 20 67 72 61 70 |lize glo|bal grap|
|000005f0| 68 69 63 20 6f 62 6a 65 | 63 74 73 0d 09 49 6e 69 |hic obje|cts..Ini|
|00000600| 74 43 6f 6d 6d 6f 6e 47 | 72 61 70 68 69 63 4f 62 |tCommonG|raphicOb|
|00000610| 6a 65 63 74 73 28 29 3b | 0d 09 72 65 74 75 72 6e |jects();|..return|
|00000620| 28 74 72 75 65 29 3b 0d | 7d 0d 0d 2f 2f 20 20 20 |(true);.|}..// |
|00000630| 41 20 63 68 61 6e 63 65 | 20 74 6f 20 70 72 65 2d |A chance| to pre-|
|00000640| 68 61 6e 64 6c 65 20 61 | 6e 20 65 76 65 6e 74 20 |handle a|n event |
|00000650| 0d 42 6f 6f 6c 65 61 6e | 20 41 70 70 44 6f 45 76 |.Boolean| AppDoEv|
|00000660| 65 6e 74 28 45 76 65 6e | 74 52 65 63 6f 72 64 20 |ent(Even|tRecord |
|00000670| 2a 65 76 65 6e 74 29 0d | 7b 0d 09 42 6f 6f 6c 65 |*event).|{..Boole|
|00000680| 61 6e 09 09 09 68 61 6e | 64 6c 65 64 20 3d 20 66 |an...han|dled = f|
|00000690| 61 6c 73 65 3b 0d 09 43 | 75 72 73 48 61 6e 64 6c |alse;..C|ursHandl|
|000006a0| 65 09 09 63 75 72 73 3b | 0d 09 0d 09 2f 2f 20 21 |e..curs;|....// !|
|000006b0| 21 21 20 62 65 20 6d 6f | 72 65 20 65 66 66 69 63 |!! be mo|re effic|
|000006c0| 69 65 6e 74 20 68 65 72 | 65 0d 09 2f 2f 20 41 64 |ient her|e..// Ad|
|000006d0| 6a 75 73 74 20 63 75 72 | 73 6f 72 0d 09 69 66 28 |just cur|sor..if(|
|000006e0| 65 76 65 6e 74 2d 3e 6d | 6f 64 69 66 69 65 72 73 |event->m|odifiers|
|000006f0| 20 26 20 6f 70 74 69 6f | 6e 4b 65 79 29 0d 09 7b | & optio|nKey)..{|
|00000700| 0d 09 09 63 75 72 73 20 | 3d 20 47 65 74 43 75 72 |...curs |= GetCur|
|00000710| 73 6f 72 28 6b 54 68 75 | 6d 62 43 75 72 73 6f 72 |sor(kThu|mbCursor|
|00000720| 49 44 29 3b 0d 09 09 53 | 65 74 43 75 72 73 6f 72 |ID);...S|etCursor|
|00000730| 28 2a 63 75 72 73 29 3b | 0d 09 7d 0d 09 65 6c 73 |(*curs);|..}..els|
|00000740| 65 0d 09 09 53 65 74 43 | 75 72 73 6f 72 28 26 71 |e...SetC|ursor(&q|
|00000750| 64 2e 61 72 72 6f 77 29 | 3b 0d 0d 09 72 65 74 75 |d.arrow)|;...retu|
|00000760| 72 6e 20 68 61 6e 64 6c | 65 64 3b 0d 7d 0d 0d 2f |rn handl|ed;.}../|
|00000770| 2f 20 43 61 6c 6c 65 64 | 20 74 6f 20 68 61 6e 64 |/ Called| to hand|
|00000780| 6c 65 20 61 6e 20 61 63 | 74 69 76 61 74 65 20 65 |le an ac|tivate e|
|00000790| 76 65 6e 74 0d 76 6f 69 | 64 20 41 70 70 41 63 74 |vent.voi|d AppAct|
|000007a0| 69 76 61 74 65 28 57 69 | 6e 64 6f 77 50 74 72 20 |ivate(Wi|ndowPtr |
|000007b0| 77 69 6e 64 2c 20 42 6f | 6f 6c 65 61 6e 20 61 63 |wind, Bo|olean ac|
|000007c0| 74 69 76 61 74 65 29 0d | 7b 0d 7d 0d 0d 2f 2f 20 |tivate).|{.}..// |
|000007d0| 43 61 6c 6c 65 64 20 77 | 68 65 6e 20 61 20 77 69 |Called w|hen a wi|
|000007e0| 6e 64 6f 77 20 6e 65 65 | 64 73 20 75 70 64 61 74 |ndow nee|ds updat|
|000007f0| 69 6e 67 2e 20 42 65 67 | 69 6e 55 70 64 61 74 65 |ing. Beg|inUpdate|
|00000800| 28 29 20 68 61 73 20 61 | 6c 72 65 61 64 79 20 62 |() has a|lready b|
|00000810| 65 65 6e 20 63 61 6c 6c | 65 64 2c 20 61 6e 64 20 |een call|ed, and |
|00000820| 74 68 65 20 0d 2f 2f 20 | 70 6f 72 74 20 69 73 20 |the .// |port is |
|00000830| 73 65 74 20 74 6f 20 74 | 68 65 20 61 70 70 72 6f |set to t|he appro|
|00000840| 70 72 69 61 74 65 20 77 | 69 6e 64 6f 77 0d 76 6f |priate w|indow.vo|
|00000850| 69 64 20 41 70 70 55 70 | 64 61 74 65 28 57 69 6e |id AppUp|date(Win|
|00000860| 64 6f 77 50 74 72 20 77 | 69 6e 64 29 0d 7b 0d 09 |dowPtr w|ind).{..|
|00000870| 2f 2f 20 44 72 61 77 20 | 74 68 65 20 63 6f 6e 74 |// Draw |the cont|
|00000880| 65 6e 74 0d 09 41 70 70 | 44 72 61 77 43 6f 6e 74 |ent..App|DrawCont|
|00000890| 65 6e 74 28 77 69 6e 64 | 29 3b 0d 7d 0d 0d 2f 2f |ent(wind|);.}..//|
|000008a0| 20 44 72 61 77 20 74 68 | 65 20 63 6f 6e 74 65 6e | Draw th|e conten|
|000008b0| 74 20 6e 6f 77 2c 20 61 | 73 73 75 6d 69 6e 67 20 |t now, a|ssuming |
|000008c0| 74 68 65 20 70 6f 72 74 | 2c 20 63 6c 69 70 2c 20 |the port|, clip, |
|000008d0| 65 74 63 2e 20 61 72 65 | 20 61 6c 6c 20 73 65 74 |etc. are| all set|
|000008e0| 20 75 70 0d 76 6f 69 64 | 20 41 70 70 44 72 61 77 | up.void| AppDraw|
|000008f0| 43 6f 6e 74 65 6e 74 28 | 57 69 6e 64 6f 77 50 74 |Content(|WindowPt|
|00000900| 72 20 77 69 6e 64 29 0d | 7b 0d 09 2f 2f 20 44 72 |r wind).|{..// Dr|
|00000910| 61 77 20 74 68 65 20 70 | 61 67 65 20 73 68 61 70 |aw the p|age shap|
|00000920| 65 0d 09 47 58 44 72 61 | 77 53 68 61 70 65 28 47 |e..GXDra|wShape(G|
|00000930| 65 74 57 69 6e 64 6f 77 | 47 58 53 68 61 70 65 28 |etWindow|GXShape(|
|00000940| 77 69 6e 64 29 29 3b 0d | 09 47 58 44 72 61 77 53 |wind));.|.GXDrawS|
|00000950| 68 61 70 65 20 28 47 65 | 74 44 6f 63 46 61 64 65 |hape (Ge|tDocFade|
|00000960| 64 54 68 72 6f 77 73 50 | 69 63 74 28 77 69 6e 64 |dThrowsP|ict(wind|
|00000970| 29 29 3b 0d 7d 0d 0d 2f | 2f 20 43 61 6c 6c 65 64 |));.}../|/ Called|
|00000980| 20 77 68 65 6e 20 74 68 | 65 20 73 68 65 6c 6c 20 | when th|e shell |
|00000990| 72 65 63 69 65 76 65 73 | 20 61 20 6e 75 6c 6c 20 |recieves| a null |
|000009a0| 65 76 65 6e 74 2e 0d 76 | 6f 69 64 20 41 70 70 49 |event..v|oid AppI|
|000009b0| 64 6c 65 28 45 76 65 6e | 74 52 65 63 6f 72 64 20 |dle(Even|tRecord |
|000009c0| 2a 45 76 65 6e 74 29 0d | 7b 0d 7d 0d 0d 2f 2a 20 |*Event).|{.}../* |
|000009d0| 43 61 6c 6c 65 64 20 77 | 68 65 6e 20 74 68 65 72 |Called w|hen ther|
|000009e0| 65 20 69 73 20 61 20 63 | 6c 69 63 6b 20 69 6e 20 |e is a c|lick in |
|000009f0| 74 68 65 20 63 6f 6e 74 | 65 6e 74 20 6f 66 20 61 |the cont|ent of a|
|00000a00| 20 77 69 6e 64 6f 77 2e | 20 54 68 65 20 70 6f 72 | window.| The por|
|00000a10| 74 20 69 73 20 61 6c 72 | 65 61 64 79 20 73 65 74 |t is alr|eady set|
|00000a20| 20 74 6f 20 0d 74 68 65 | 20 77 69 6e 64 6f 77 2c | to .the| window,|
|00000a30| 20 61 6e 64 20 74 68 65 | 50 74 20 69 73 20 69 6e | and the|Pt is in|
|00000a40| 20 6c 6f 63 61 6c 20 63 | 6f 6f 72 64 73 2e 20 20 | local c|oords. |
|00000a50| 2a 2f 0d 76 6f 69 64 20 | 41 70 70 43 6c 69 63 6b |*/.void |AppClick|
|00000a60| 28 50 6f 69 6e 74 20 74 | 68 65 50 74 2c 20 57 69 |(Point t|hePt, Wi|
|00000a70| 6e 64 6f 77 50 74 72 20 | 77 69 6e 64 2c 20 42 6f |ndowPtr |wind, Bo|
|00000a80| 6f 6c 65 61 6e 20 64 6f | 75 62 6c 65 43 6c 69 63 |olean do|ubleClic|
|00000a90| 6b 2c 20 45 76 65 6e 74 | 52 65 63 6f 72 64 20 2a |k, Event|Record *|
|00000aa0| 65 76 65 6e 74 70 74 72 | 29 0d 7b 0d 09 44 6f 4a |eventptr|).{..DoJ|
|00000ab0| 75 67 67 6c 65 43 6c 69 | 63 6b 28 77 69 6e 64 2c |uggleCli|ck(wind,|
|00000ac0| 20 74 68 65 50 74 2c 20 | 65 76 65 6e 74 70 74 72 | thePt, |eventptr|
|00000ad0| 29 3b 0d 7d 0d 0d 2f 2f | 20 20 43 61 6c 6c 65 64 |);.}..//| Called|
|00000ae0| 20 77 68 65 6e 20 74 68 | 65 72 65 20 69 73 20 61 | when th|ere is a|
|00000af0| 20 6b 65 79 44 6f 77 6e | 20 65 76 65 6e 74 20 0d | keyDown| event .|
|00000b00| 76 6f 69 64 20 09 41 70 | 70 4b 65 79 44 6f 77 6e |void .Ap|pKeyDown|
|00000b10| 28 63 68 61 72 20 6b 65 | 79 2c 20 45 76 65 6e 74 |(char ke|y, Event|
|00000b20| 52 65 63 6f 72 64 20 2a | 65 76 65 6e 74 70 74 72 |Record *|eventptr|
|00000b30| 29 0d 7b 0d 7d 0d 0d 2f | 2f 20 43 61 6c 6c 65 64 |).{.}../|/ Called|
|00000b40| 20 61 66 74 65 72 20 74 | 68 65 20 75 73 65 72 20 | after t|he user |
|00000b50| 68 61 73 20 72 65 73 69 | 7a 65 64 20 61 20 77 69 |has resi|zed a wi|
|00000b60| 6e 64 6f 77 2e 20 44 6f | 6e 27 74 20 66 6f 72 67 |ndow. Do|n't forg|
|00000b70| 65 74 20 74 6f 20 61 63 | 63 6f 75 6e 74 20 66 6f |et to ac|count fo|
|00000b80| 72 20 74 68 65 20 73 63 | 72 6f 6c 6c 20 62 61 72 |r the sc|roll bar|
|00000b90| 73 0d 76 6f 69 64 20 41 | 70 70 47 72 6f 77 57 69 |s.void A|ppGrowWi|
|00000ba0| 6e 64 6f 77 28 57 69 6e | 64 6f 77 50 74 72 20 77 |ndow(Win|dowPtr w|
|00000bb0| 69 6e 64 2c 20 73 68 6f | 72 74 20 68 53 69 7a 65 |ind, sho|rt hSize|
|00000bc0| 2c 20 73 68 6f 72 74 20 | 76 53 69 7a 65 29 0d 7b |, short |vSize).{|
|00000bd0| 0d 7d 0d 0d 2f 2a 20 43 | 61 6c 6c 65 64 20 77 68 |.}../* C|alled wh|
|00000be0| 65 6e 20 74 68 65 20 75 | 73 65 72 20 63 6c 69 63 |en the u|ser clic|
|00000bf0| 6b 73 20 69 6e 20 74 68 | 65 20 7a 6f 6f 6d 20 62 |ks in th|e zoom b|
|00000c00| 6f 78 20 6f 66 20 61 20 | 77 69 6e 64 6f 77 2e 20 |ox of a |window. |
|00000c10| 49 74 20 63 61 6c 6c 73 | 20 61 20 72 6f 75 74 69 |It calls| a routi|
|00000c20| 6e 65 20 74 6f 20 66 69 | 6e 64 0d 61 6e 64 20 69 |ne to fi|nd.and i|
|00000c30| 6e 73 74 61 6c 6c 20 74 | 68 65 20 61 70 70 72 6f |nstall t|he appro|
|00000c40| 70 72 69 61 74 65 20 7a | 6f 6f 6d 20 72 65 63 74 |priate z|oom rect|
|00000c50| 2c 20 74 68 65 6e 20 7a | 6f 6f 6d 73 20 69 74 2c |, then z|ooms it,|
|00000c60| 20 61 64 6a 75 73 74 69 | 6e 67 20 74 68 65 20 73 | adjusti|ng the s|
|00000c70| 63 72 6f 6c 6c 20 62 61 | 72 73 20 61 6e 64 20 73 |croll ba|rs and s|
|00000c80| 6f 20 0d 6f 6e 20 2a 2f | 0d 76 6f 69 64 20 41 70 |o .on */|.void Ap|
|00000c90| 70 5a 6f 6f 6d 57 69 6e | 64 6f 77 28 57 69 6e 64 |pZoomWin|dow(Wind|
|00000ca0| 6f 77 50 74 72 20 77 69 | 6e 64 2c 20 73 68 6f 72 |owPtr wi|nd, shor|
|00000cb0| 74 20 7a 6f 6f 6d 44 69 | 72 29 0d 7b 0d 7d 0d 09 |t zoomDi|r).{.}..|
|00000cc0| 0d 2f 2a 20 43 61 6c 6c | 65 64 20 77 68 65 6e 20 |./* Call|ed when |
|00000cd0| 74 68 65 72 65 20 69 73 | 20 61 20 63 6c 69 63 6b |there is| a click|
|00000ce0| 20 69 6e 20 74 68 65 20 | 6d 65 6e 75 20 62 61 72 | in the |menu bar|
|00000cf0| 2c 20 62 65 66 6f 72 65 | 20 74 68 65 20 6d 65 6e |, before| the men|
|00000d00| 75 20 69 73 20 73 68 6f | 77 6e 2e 20 54 68 69 73 |u is sho|wn. This|
|00000d10| 20 69 73 0d 74 68 65 20 | 61 70 70 27 73 20 6f 70 | is.the |app's op|
|00000d20| 70 6f 72 74 75 6e 69 74 | 79 20 74 6f 20 65 6e 61 |portunit|y to ena|
|00000d30| 62 6c 65 20 61 6e 64 20 | 64 69 73 61 62 6c 65 20 |ble and |disable |
|00000d40| 69 74 73 20 6d 65 6e 75 | 20 69 74 65 6d 73 2e 20 |its menu| items. |
|00000d50| 2a 2f 0d 76 6f 69 64 20 | 41 70 70 41 64 6a 75 73 |*/.void |AppAdjus|
|00000d60| 74 4d 65 6e 75 73 28 29 | 0d 7b 0d 09 4d 65 6e 75 |tMenus()|.{..Menu|
|00000d70| 48 61 6e 64 6c 65 09 6d | 68 6e 64 6c 3b 0d 09 42 |Handle.m|hndl;..B|
|00000d80| 6f 6f 6c 65 61 6e 09 09 | 77 69 6e 64 6f 77 55 70 |oolean..|windowUp|
|00000d90| 3b 0d 09 09 09 0d 09 77 | 69 6e 64 6f 77 55 70 20 |;......w|indowUp |
|00000da0| 3d 20 28 46 72 6f 6e 74 | 57 69 6e 64 6f 77 28 29 |= (Front|Window()|
|00000db0| 20 21 3d 20 6e 69 6c 20 | 26 26 20 49 73 41 70 70 | != nil |&& IsApp|
|00000dc0| 57 69 6e 64 6f 77 28 46 | 72 6f 6e 74 57 69 6e 64 |Window(F|rontWind|
|00000dd0| 6f 77 28 29 29 29 3b 0d | 09 6d 68 6e 64 6c 20 3d |ow()));.|.mhndl =|
|00000de0| 20 67 41 70 70 4d 65 6e | 75 48 61 6e 64 6c 65 73 | gAppMen|uHandles|
|00000df0| 5b 6b 4a 75 67 67 6c 65 | 4d 65 6e 75 5d 3b 0d 0d |[kJuggle|Menu];..|
|00000e00| 09 2f 2f 20 4f 4b 2c 20 | 66 69 72 73 74 20 74 68 |.// OK, |first th|
|00000e10| 65 20 4a 75 67 67 6c 65 | 20 6d 65 6e 75 2e 20 49 |e Juggle| menu. I|
|00000e20| 66 20 61 20 77 69 6e 64 | 6f 77 20 69 73 20 75 70 |f a wind|ow is up|
|00000e30| 2c 20 74 68 65 6e 20 65 | 6e 61 62 6c 65 20 69 74 |, then e|nable it|
|00000e40| 0d 09 69 66 28 77 69 6e | 64 6f 77 55 70 29 0d 09 |..if(win|dowUp)..|
|00000e50| 09 45 6e 61 62 6c 65 49 | 74 65 6d 28 6d 68 6e 64 |.EnableI|tem(mhnd|
|00000e60| 6c 2c 20 30 29 3b 0d 09 | 65 6c 73 65 0d 09 09 44 |l, 0);..|else...D|
|00000e70| 69 73 61 62 6c 65 49 74 | 65 6d 28 6d 68 6e 64 6c |isableIt|em(mhndl|
|00000e80| 2c 20 30 29 3b 0d 09 0d | 09 2f 2f 20 50 61 74 74 |, 0);...|.// Patt|
|00000e90| 65 72 6e 73 20 4d 65 6e | 75 20 69 73 20 61 6c 77 |erns Men|u is alw|
|00000ea0| 61 79 73 20 65 6e 61 62 | 6c 65 64 0d 09 0d 09 2f |ays enab|led..../|
|00000eb0| 2f 20 4d 61 6b 65 20 73 | 75 72 65 20 74 6f 20 73 |/ Make s|ure to s|
|00000ec0| 68 6f 77 20 72 65 73 75 | 6c 74 73 0d 09 44 72 61 |how resu|lts..Dra|
|00000ed0| 77 4d 65 6e 75 42 61 72 | 28 29 3b 0d 7d 09 0d 0d |wMenuBar|();.}...|
|00000ee0| 2f 2f 20 20 63 61 6c 6c | 65 64 20 77 68 65 6e 20 |// call|ed when |
|00000ef0| 61 20 6d 65 6e 75 20 6f | 74 68 65 72 20 74 68 61 |a menu o|ther tha|
|00000f00| 6e 20 41 70 70 6c 65 2c | 20 46 69 6c 65 2c 20 6f |n Apple,| File, o|
|00000f10| 72 20 45 64 69 74 20 69 | 73 20 75 73 65 64 2e 20 |r Edit i|s used. |
|00000f20| 0d 76 6f 69 64 20 41 70 | 70 4d 65 6e 75 28 73 68 |.void Ap|pMenu(sh|
|00000f30| 6f 72 74 20 6d 65 6e 75 | 49 44 2c 20 73 68 6f 72 |ort menu|ID, shor|
|00000f40| 74 20 6d 65 6e 75 49 74 | 65 6d 29 0d 7b 0d 09 57 |t menuIt|em).{..W|
|00000f50| 69 6e 64 6f 77 50 74 72 | 09 09 77 69 6e 64 20 3d |indowPtr|..wind =|
|00000f60| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 28 29 3b 0d | FrontWi|ndow();.|
|00000f70| 09 0d 09 73 77 69 74 63 | 68 28 6d 65 6e 75 49 44 |...switc|h(menuID|
|00000f80| 29 0d 09 7b 0d 09 09 63 | 61 73 65 20 6b 4a 75 67 |)..{...c|ase kJug|
|00000f90| 67 6c 65 4d 65 6e 75 49 | 44 3a 0d 09 09 09 73 77 |gleMenuI|D:....sw|
|00000fa0| 69 74 63 68 28 6d 65 6e | 75 49 74 65 6d 29 0d 09 |itch(men|uItem)..|
|00000fb0| 09 09 7b 0d 09 09 09 09 | 63 61 73 65 20 69 52 65 |..{.....|case iRe|
|00000fc0| 73 69 7a 65 4a 75 67 67 | 6c 65 3a 0d 09 09 09 09 |sizeJugg|le:.....|
|00000fd0| 09 77 69 6e 64 20 3d 20 | 52 65 73 69 7a 65 4a 75 |.wind = |ResizeJu|
|00000fe0| 67 67 6c 65 28 77 69 6e | 64 29 3b 0d 09 09 09 09 |ggle(win|d);.....|
|00000ff0| 09 69 66 28 77 69 6e 64 | 20 21 3d 20 6e 69 6c 29 |.if(wind| != nil)|
|00001000| 0d 09 09 09 09 09 7b 0d | 09 09 09 09 09 09 53 65 |......{.|......Se|
|00001010| 74 50 6f 72 74 28 77 69 | 6e 64 29 3b 0d 09 09 09 |tPort(wi|nd);....|
|00001020| 09 09 09 45 72 61 73 65 | 52 65 63 74 28 26 77 69 |...Erase|Rect(&wi|
|00001030| 6e 64 2d 3e 70 6f 72 74 | 52 65 63 74 29 3b 0d 09 |nd->port|Rect);..|
|00001040| 09 09 09 09 09 49 6e 76 | 61 6c 52 65 63 74 28 26 |.....Inv|alRect(&|
|00001050| 77 69 6e 64 2d 3e 70 6f | 72 74 52 65 63 74 29 3b |wind->po|rtRect);|
|00001060| 0d 09 09 09 09 09 7d 0d | 09 09 09 09 09 65 6c 73 |......}.|.....els|
|00001070| 65 0d 09 09 09 09 09 09 | 53 79 73 42 65 65 70 28 |e.......|SysBeep(|
|00001080| 31 30 29 3b 0d 09 09 09 | 09 09 62 72 65 61 6b 3b |10);....|..break;|
|00001090| 0d 09 09 09 09 09 0d 09 | 09 09 09 63 61 73 65 20 |........|...case |
|000010a0| 69 41 64 64 4a 75 67 67 | 6c 65 72 3a 0d 09 09 09 |iAddJugg|ler:....|
|000010b0| 09 09 69 66 28 41 64 64 | 4a 75 67 67 6c 65 72 28 |..if(Add|Juggler(|
|000010c0| 47 65 74 57 69 6e 64 6f | 77 4a 75 67 67 6c 65 28 |GetWindo|wJuggle(|
|000010d0| 77 69 6e 64 29 29 29 0d | 09 09 09 09 09 7b 0d 09 |wind))).|.....{..|
|000010e0| 09 09 09 09 09 53 65 74 | 50 6f 72 74 28 77 69 6e |.....Set|Port(win|
|000010f0| 64 29 3b 0d 09 09 09 09 | 09 09 45 72 61 73 65 52 |d);.....|..EraseR|
|00001100| 65 63 74 28 26 77 69 6e | 64 2d 3e 70 6f 72 74 52 |ect(&win|d->portR|
|00001110| 65 63 74 29 3b 0d 09 09 | 09 09 09 09 49 6e 76 61 |ect);...|....Inva|
|00001120| 6c 52 65 63 74 28 26 77 | 69 6e 64 2d 3e 70 6f 72 |lRect(&w|ind->por|
|00001130| 74 52 65 63 74 29 3b 0d | 09 09 09 09 09 09 41 64 |tRect);.|......Ad|
|00001140| 6a 75 73 74 53 63 72 6f | 6c 6c 62 61 72 73 28 77 |justScro|llbars(w|
|00001150| 69 6e 64 2c 20 66 61 6c | 73 65 29 3b 0d 09 09 09 |ind, fal|se);....|
|00001160| 09 09 7d 0d 09 09 09 09 | 09 65 6c 73 65 0d 09 09 |..}.....|.else...|
|00001170| 09 09 09 09 53 79 73 42 | 65 65 70 28 31 30 29 3b |....SysB|eep(10);|
|00001180| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00001190| 09 0d 09 09 09 09 64 65 | 66 61 75 6c 74 3a 0d 09 |......de|fault:..|
|000011a0| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 7d 0d |....brea|k;....}.|
|000011b0| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 0d 09 09 64 |...break|;......d|
|000011c0| 65 66 61 75 6c 74 3a 0d | 09 09 09 62 72 65 61 6b |efault:.|...break|
|000011d0| 3b 0d 09 7d 0d 7d 0d 0d | 2f 2f 20 43 61 6c 6c 65 |;..}.}..|// Calle|
|000011e0| 64 20 77 68 65 6e 20 74 | 68 65 20 75 73 65 72 20 |d when t|he user |
|000011f0| 73 65 6c 65 63 74 73 20 | 22 4e 65 77 22 20 66 72 |selects |"New" fr|
|00001200| 6f 6d 20 74 68 65 20 46 | 69 6c 65 20 6d 65 6e 75 |om the F|ile menu|
|00001210| 2c 20 61 6e 64 20 61 74 | 20 6f 74 68 65 72 20 76 |, and at| other v|
|00001220| 61 72 69 6f 75 73 20 74 | 69 6d 65 73 09 09 09 0d |arious t|imes....|
|00001230| 57 69 6e 64 6f 77 50 74 | 72 20 41 70 70 4e 65 77 |WindowPt|r AppNew|
|00001240| 28 73 68 6f 72 74 20 6e | 75 6d 4a 75 67 67 6c 65 |(short n|umJuggle|
|00001250| 72 73 2c 20 73 68 6f 72 | 74 20 6e 75 6d 43 6f 75 |rs, shor|t numCou|
|00001260| 6e 74 73 29 0d 7b 0d 09 | 57 69 6e 64 6f 77 50 74 |nts).{..|WindowPt|
|00001270| 72 09 77 69 6e 64 20 3d | 20 6e 69 6c 3b 0d 09 4f |r.wind =| nil;..O|
|00001280| 53 45 72 72 09 09 65 72 | 72 20 3d 20 2d 31 3b 0d |SErr..er|r = -1;.|
|00001290| 09 44 6f 63 48 61 6e 64 | 6c 65 09 6e 65 77 44 6f |.DocHand|le.newDo|
|000012a0| 63 3b 0d 09 43 75 72 73 | 48 61 6e 64 6c 65 09 63 |c;..Curs|Handle.c|
|000012b0| 75 72 73 3b 0d 0d 09 2f | 2f 20 49 66 20 6e 6f 20 |urs;.../|/ If no |
|000012c0| 73 69 7a 65 20 73 70 65 | 63 69 66 69 65 64 2c 20 |size spe|cified, |
|000012d0| 61 73 6b 20 75 73 65 72 | 20 68 6f 77 20 62 69 67 |ask user| how big|
|000012e0| 20 74 6f 20 6d 61 6b 65 | 20 69 74 0d 09 69 66 28 | to make| it..if(|
|000012f0| 6e 75 6d 4a 75 67 67 6c | 65 72 73 20 3c 3d 20 30 |numJuggl|ers <= 0|
|00001300| 29 0d 09 09 44 6f 4a 75 | 67 67 6c 65 53 69 7a 65 |)...DoJu|ggleSize|
|00001310| 44 69 61 6c 6f 67 28 26 | 6e 75 6d 4a 75 67 67 6c |Dialog(&|numJuggl|
|00001320| 65 72 73 2c 20 26 6e 75 | 6d 43 6f 75 6e 74 73 29 |ers, &nu|mCounts)|
|00001330| 3b 0d 0d 09 2f 2f 20 69 | 66 20 75 73 65 72 20 63 |;...// i|f user c|
|00001340| 61 6e 63 65 6c 65 64 2c | 20 72 65 74 75 72 6e 0d |anceled,| return.|
|00001350| 09 69 66 28 6e 75 6d 4a | 75 67 67 6c 65 72 73 20 |.if(numJ|ugglers |
|00001360| 3d 3d 20 30 29 0d 09 09 | 72 65 74 75 72 6e 20 6e |== 0)...|return n|
|00001370| 69 6c 3b 0d 09 0d 09 2f | 2f 20 53 65 74 20 63 75 |il;..../|/ Set cu|
|00001380| 72 73 6f 72 20 74 6f 20 | 77 61 74 63 68 0d 09 63 |rsor to |watch..c|
|00001390| 75 72 73 20 3d 20 47 65 | 74 43 75 72 73 6f 72 28 |urs = Ge|tCursor(|
|000013a0| 77 61 74 63 68 43 75 72 | 73 6f 72 29 3b 0d 09 53 |watchCur|sor);..S|
|000013b0| 65 74 43 75 72 73 6f 72 | 28 2a 63 75 72 73 29 3b |etCursor|(*curs);|
|000013c0| 0d 09 0d 09 2f 2f 20 47 | 65 74 20 61 20 6e 65 77 |....// G|et a new|
|000013d0| 20 77 69 6e 64 6f 77 0d | 09 77 69 6e 64 20 3d 20 | window.|.wind = |
|000013e0| 47 65 74 4e 65 77 57 69 | 6e 64 6f 77 28 6b 57 69 |GetNewWi|ndow(kWi|
|000013f0| 6e 64 52 65 73 6f 75 72 | 63 65 49 44 2c 20 6e 69 |ndResour|ceID, ni|
|00001400| 6c 2c 20 28 57 69 6e 64 | 6f 77 50 74 72 29 2d 31 |l, (Wind|owPtr)-1|
|00001410| 4c 29 3b 0d 09 69 66 28 | 77 69 6e 64 20 21 3d 20 |L);..if(|wind != |
|00001420| 6e 69 6c 29 0d 09 7b 0d | 09 09 2f 2f 20 41 6c 6c |nil)..{.|..// All|
|00001430| 6f 63 61 74 65 20 74 68 | 65 20 64 6f 63 75 6d 65 |ocate th|e docume|
|00001440| 6e 74 20 73 74 72 75 63 | 74 75 72 65 0d 09 09 6e |nt struc|ture...n|
|00001450| 65 77 44 6f 63 20 3d 20 | 28 44 6f 63 48 61 6e 64 |ewDoc = |(DocHand|
|00001460| 6c 65 29 4e 65 77 48 61 | 6e 64 6c 65 43 6c 65 61 |le)NewHa|ndleClea|
|00001470| 72 28 73 69 7a 65 6f 66 | 28 44 6f 63 75 6d 65 6e |r(sizeof|(Documen|
|00001480| 74 52 65 63 6f 72 64 29 | 29 3b 0d 09 09 69 66 28 |tRecord)|);...if(|
|00001490| 6e 65 77 44 6f 63 20 21 | 3d 20 6e 69 6c 29 0d 09 |newDoc !|= nil)..|
|000014a0| 09 7b 0d 09 09 09 2f 2f | 20 73 74 6f 72 65 20 74 |.{....//| store t|
|000014b0| 68 65 20 64 6f 63 20 69 | 6e 20 74 68 65 20 77 69 |he doc i|n the wi|
|000014c0| 6e 64 6f 77 0d 09 09 09 | 53 65 74 57 52 65 66 43 |ndow....|SetWRefC|
|000014d0| 6f 6e 28 77 69 6e 64 2c | 20 28 6c 6f 6e 67 29 6e |on(wind,| (long)n|
|000014e0| 65 77 44 6f 63 29 3b 0d | 09 09 09 0d 09 09 09 2f |ewDoc);.|......./|
|000014f0| 2f 20 49 6e 69 74 69 61 | 6c 69 7a 65 20 74 68 65 |/ Initia|lize the|
|00001500| 20 73 74 61 6e 64 61 72 | 64 20 64 6f 63 75 6d 65 | standar|d docume|
|00001510| 6e 74 20 73 74 75 66 66 | 0d 09 09 09 65 72 72 20 |nt stuff|....err |
|00001520| 3d 20 49 6e 69 74 53 74 | 64 44 6f 63 28 77 69 6e |= InitSt|dDoc(win|
|00001530| 64 29 3b 0d 09 09 09 69 | 66 28 65 72 72 20 3d 3d |d);....i|f(err ==|
|00001540| 20 6e 6f 45 72 72 29 0d | 09 09 09 7b 0d 09 09 09 | noErr).|...{....|
|00001550| 09 2f 2f 20 54 72 79 20 | 74 6f 20 73 65 74 20 75 |.// Try |to set u|
|00001560| 70 20 74 68 65 20 6a 75 | 67 67 6c 65 2e 0d 09 09 |p the ju|ggle....|
|00001570| 09 09 65 72 72 20 3d 20 | 49 6e 69 74 4a 75 67 67 |..err = |InitJugg|
|00001580| 6c 65 28 77 69 6e 64 2c | 20 6e 75 6d 4a 75 67 67 |le(wind,| numJugg|
|00001590| 6c 65 72 73 2c 20 6e 75 | 6d 43 6f 75 6e 74 73 29 |lers, nu|mCounts)|
|000015a0| 3b 0d 09 09 09 09 69 66 | 28 65 72 72 20 3d 3d 20 |;.....if|(err == |
|000015b0| 6e 6f 45 72 72 29 0d 09 | 09 09 09 7b 0d 09 09 09 |noErr)..|...{....|
|000015c0| 09 09 2f 2f 20 20 46 69 | 6e 61 6c 6c 79 2c 20 70 |..// Fi|nally, p|
|000015d0| 6f 73 69 74 69 6f 6e 20 | 61 6e 64 20 73 68 6f 77 |osition |and show|
|000015e0| 20 74 68 65 20 77 69 6e | 64 6f 77 0d 09 09 09 09 | the win|dow.....|
|000015f0| 09 53 65 74 55 70 41 6e | 64 53 68 6f 77 57 69 6e |.SetUpAn|dShowWin|
|00001600| 64 6f 77 28 77 69 6e 64 | 29 3b 0d 09 09 09 09 7d |dow(wind|);.....}|
|00001610| 0d 09 09 09 7d 0d 09 09 | 7d 0d 09 7d 0d 09 09 0d |....}...|}..}....|
|00001620| 09 2f 2f 20 43 6c 65 61 | 6e 20 75 70 20 69 66 20 |.// Clea|n up if |
|00001630| 74 68 65 72 65 20 77 65 | 72 65 20 65 72 72 6f 72 |there we|re error|
|00001640| 73 09 09 0d 09 69 66 28 | 65 72 72 20 21 3d 20 6e |s....if(|err != n|
|00001650| 6f 45 72 72 29 0d 09 7b | 0d 09 09 44 6f 45 72 72 |oErr)..{|...DoErr|
|00001660| 6f 72 41 6c 65 72 74 28 | 6b 4e 6f 4d 65 6d 53 74 |orAlert(|kNoMemSt|
|00001670| 72 2c 20 30 29 3b 0d 09 | 09 69 66 28 6e 65 77 44 |r, 0);..|.if(newD|
|00001680| 6f 63 20 21 3d 20 6e 69 | 6c 29 0d 09 09 7b 0d 09 |oc != ni|l)...{..|
|00001690| 09 09 44 69 73 70 6f 73 | 65 48 61 6e 64 6c 65 28 |..Dispos|eHandle(|
|000016a0| 28 48 61 6e 64 6c 65 29 | 6e 65 77 44 6f 63 29 3b |(Handle)|newDoc);|
|000016b0| 0d 09 09 09 6e 65 77 44 | 6f 63 20 3d 20 6e 69 6c |....newD|oc = nil|
|000016c0| 3b 0d 09 09 7d 0d 09 09 | 69 66 28 77 69 6e 64 20 |;...}...|if(wind |
|000016d0| 21 3d 20 6e 69 6c 29 0d | 09 09 7b 0d 09 09 09 44 |!= nil).|..{....D|
|000016e0| 69 73 70 6f 73 65 57 69 | 6e 64 6f 77 28 77 69 6e |isposeWi|ndow(win|
|000016f0| 64 29 3b 0d 09 09 09 77 | 69 6e 64 20 3d 20 6e 69 |d);....w|ind = ni|
|00001700| 6c 3b 0d 09 09 7d 0d 09 | 7d 0d 0d 09 2f 2f 20 53 |l;...}..|}...// S|
|00001710| 65 74 20 63 75 72 73 6f | 72 20 62 61 63 6b 20 74 |et curso|r back t|
|00001720| 6f 20 61 72 72 6f 77 0d | 09 53 65 74 43 75 72 73 |o arrow.|.SetCurs|
|00001730| 6f 72 28 26 71 64 2e 61 | 72 72 6f 77 29 3b 0d 09 |or(&qd.a|rrow);..|
|00001740| 0d 09 2f 2f 20 72 65 74 | 75 72 6e 20 77 69 6e 64 |..// ret|urn wind|
|00001750| 6f 77 20 70 6f 69 6e 74 | 65 72 20 28 70 6f 73 73 |ow point|er (poss|
|00001760| 69 62 6c 79 20 6e 69 6c | 29 0d 09 72 65 74 75 72 |ibly nil|)..retur|
|00001770| 6e 20 77 69 6e 64 3b 0d | 7d 0d 0d 2f 2a 20 43 61 |n wind;.|}../* Ca|
|00001780| 6c 6c 65 64 20 77 68 65 | 6e 20 74 68 65 20 75 73 |lled whe|n the us|
|00001790| 65 72 20 73 65 6c 65 63 | 74 73 20 22 4f 70 65 6e |er selec|ts "Open|
|000017a0| 22 20 66 72 6f 6d 20 74 | 68 65 20 46 69 6c 65 20 |" from t|he File |
|000017b0| 6d 65 6e 75 2e 20 2a 2f | 0d 76 6f 69 64 09 41 70 |menu. */|.void.Ap|
|000017c0| 70 4f 70 65 6e 28 76 6f | 69 64 29 0d 7b 0d 09 53 |pOpen(vo|id).{..S|
|000017d0| 46 54 79 70 65 4c 69 73 | 74 09 09 09 74 79 70 65 |FTypeLis|t...type|
|000017e0| 4c 69 73 74 3b 0d 09 73 | 68 6f 72 74 09 09 09 09 |List;..s|hort....|
|000017f0| 65 72 72 3b 0d 09 53 74 | 61 6e 64 61 72 64 46 69 |err;..St|andardFi|
|00001800| 6c 65 52 65 70 6c 79 09 | 72 65 70 6c 79 3b 0d 09 |leReply.|reply;..|
|00001810| 0d 09 2f 2a 20 6f 6e 6c | 79 20 73 68 6f 77 20 4a |../* onl|y show J|
|00001820| 55 47 4c 20 66 69 6c 65 | 73 20 2a 2f 0d 09 74 79 |UGL file|s */..ty|
|00001830| 70 65 4c 69 73 74 5b 30 | 5d 20 3d 20 6b 4a 75 67 |peList[0|] = kJug|
|00001840| 67 6c 65 46 69 6c 65 54 | 79 70 65 3b 0d 09 0d 09 |gleFileT|ype;....|
|00001850| 2f 2a 20 53 74 61 6e 64 | 61 72 64 20 46 69 6c 65 |/* Stand|ard File|
|00001860| 20 44 69 61 6c 6f 67 2c | 20 73 79 73 74 65 6d 20 | Dialog,| system |
|00001870| 37 20 73 74 79 6c 65 20 | 2a 2f 0d 09 53 74 61 6e |7 style |*/..Stan|
|00001880| 64 61 72 64 47 65 74 46 | 69 6c 65 28 6e 69 6c 2c |dardGetF|ile(nil,|
|00001890| 20 31 2c 20 74 79 70 65 | 4c 69 73 74 2c 20 26 72 | 1, type|List, &r|
|000018a0| 65 70 6c 79 29 3b 0d 09 | 0d 09 2f 2a 20 49 66 20 |eply);..|../* If |
|000018b0| 74 68 65 79 20 63 6c 69 | 63 6b 65 64 20 22 6f 70 |they cli|cked "op|
|000018c0| 65 6e 22 2e 2e 2e 20 2a | 2f 0d 09 69 66 28 72 65 |en"... *|/..if(re|
|000018d0| 70 6c 79 2e 73 66 47 6f | 6f 64 20 3d 3d 20 74 72 |ply.sfGo|od == tr|
|000018e0| 75 65 29 0d 09 7b 0d 09 | 09 2f 2a 20 41 20 62 69 |ue)..{..|./* A bi|
|000018f0| 67 20 67 6e 61 72 6c 79 | 20 72 6f 75 74 69 6e 65 |g gnarly| routine|
|00001900| 20 74 68 61 74 20 73 65 | 74 73 20 65 76 65 72 79 | that se|ts every|
|00001910| 74 68 69 6e 67 20 75 70 | 20 61 6e 64 20 72 65 61 |thing up| and rea|
|00001920| 64 73 20 69 6e 20 74 68 | 65 20 6a 75 67 67 6c 65 |ds in th|e juggle|
|00001930| 20 2a 2f 0d 09 09 65 72 | 72 20 3d 20 4f 70 65 6e | */...er|r = Open|
|00001940| 4a 75 67 67 6c 65 46 69 | 6c 65 28 26 72 65 70 6c |JuggleFi|le(&repl|
|00001950| 79 2e 73 66 46 69 6c 65 | 2c 20 6e 69 6c 29 3b 0d |y.sfFile|, nil);.|
|00001960| 09 09 69 66 28 65 72 72 | 20 21 3d 20 6e 6f 45 72 |..if(err| != noEr|
|00001970| 72 29 0d 09 09 09 53 79 | 73 42 65 65 70 28 31 30 |r)....Sy|sBeep(10|
|00001980| 29 3b 0d 09 7d 0d 7d 0d | 0d 0d 2f 2f 20 43 61 6c |);..}.}.|..// Cal|
|00001990| 6c 65 64 20 77 68 65 6e | 20 74 68 65 20 77 69 6e |led when| the win|
|000019a0| 64 6f 77 20 73 68 6f 75 | 6c 64 20 62 65 20 63 6c |dow shou|ld be cl|
|000019b0| 6f 73 65 64 2c 20 61 73 | 73 75 6d 65 20 73 61 76 |osed, as|sume sav|
|000019c0| 69 6e 67 20 68 61 73 20 | 68 61 70 70 65 6e 65 64 |ing has |happened|
|000019d0| 2c 20 69 66 20 6e 65 63 | 65 73 73 61 72 79 09 09 |, if nec|essary..|
|000019e0| 0d 76 6f 69 64 20 41 70 | 70 43 6c 6f 73 65 28 57 |.void Ap|pClose(W|
|000019f0| 69 6e 64 6f 77 50 74 72 | 20 77 69 6e 64 29 0d 7b |indowPtr| wind).{|
|00001a00| 0d 09 44 6f 63 48 61 6e | 64 6c 65 20 64 6f 63 3b |..DocHan|dle doc;|
|00001a10| 0d 09 09 0d 09 64 6f 63 | 20 3d 20 47 65 74 57 69 |.....doc| = GetWi|
|00001a20| 6e 64 6f 77 44 6f 63 28 | 77 69 6e 64 29 3b 0d 09 |ndowDoc(|wind);..|
|00001a30| 69 66 28 64 6f 63 20 21 | 3d 20 6e 69 6c 29 0d 09 |if(doc !|= nil)..|
|00001a40| 7b 0d 09 09 69 66 28 28 | 2a 64 6f 63 29 2d 3e 64 |{...if((|*doc)->d|
|00001a50| 6f 63 50 61 67 65 20 21 | 3d 20 6e 69 6c 29 0d 09 |ocPage !|= nil)..|
|00001a60| 09 09 47 58 44 69 73 70 | 6f 73 65 53 68 61 70 65 |..GXDisp|oseShape|
|00001a70| 28 28 2a 64 6f 63 29 2d | 3e 64 6f 63 50 61 67 65 |((*doc)-|>docPage|
|00001a80| 29 3b 20 09 2f 2f 20 44 | 69 73 70 6f 73 65 20 6f |); .// D|ispose o|
|00001a90| 66 20 74 68 69 73 20 64 | 6f 63 27 73 20 73 68 61 |f this d|oc's sha|
|00001aa0| 70 65 2e 0d 09 09 69 66 | 28 28 2a 64 6f 63 29 2d |pe....if|((*doc)-|
|00001ab0| 3e 64 6f 63 4a 6f 62 20 | 21 3d 20 6e 69 6c 29 0d |>docJob |!= nil).|
|00001ac0| 09 09 09 47 58 44 69 73 | 70 6f 73 65 4a 6f 62 28 |...GXDis|poseJob(|
|00001ad0| 28 2a 64 6f 63 29 2d 3e | 64 6f 63 4a 6f 62 29 3b |(*doc)->|docJob);|
|00001ae0| 09 09 2f 2f 20 44 69 73 | 70 6f 73 65 20 6f 66 20 |..// Dis|pose of |
|00001af0| 74 68 69 73 20 64 6f 63 | 27 73 20 70 72 69 6e 74 |this doc|'s print|
|00001b00| 20 6a 6f 62 2e 0d 09 09 | 09 0d 09 09 2f 2f 20 43 | job....|....// C|
|00001b10| 6c 65 61 6e 20 75 70 20 | 74 68 65 20 6a 75 67 67 |lean up |the jugg|
|00001b20| 6c 65 20 62 69 74 73 0d | 09 09 43 6c 65 61 6e 55 |le bits.|..CleanU|
|00001b30| 70 4a 75 67 67 6c 65 28 | 77 69 6e 64 2c 20 74 72 |pJuggle(|wind, tr|
|00001b40| 75 65 29 3b 0d 09 09 0d | 09 09 2f 2f 20 46 69 6e |ue);....|..// Fin|
|00001b50| 61 6c 6c 79 20 6b 69 6c | 6c 20 74 68 65 20 64 6f |ally kil|l the do|
|00001b60| 63 2f 6a 75 67 67 6c 65 | 20 69 74 73 65 6c 66 0d |c/juggle| itself.|
|00001b70| 09 09 44 69 73 70 6f 73 | 65 48 61 6e 64 6c 65 28 |..Dispos|eHandle(|
|00001b80| 28 48 61 6e 64 6c 65 29 | 64 6f 63 29 3b 0d 09 7d |(Handle)|doc);..}|
|00001b90| 0d 09 44 69 73 70 6f 73 | 65 57 69 6e 64 6f 77 28 |..Dispos|eWindow(|
|00001ba0| 77 69 6e 64 29 3b 0d 7d | 0d 0d 2f 2a 20 43 61 6c |wind);.}|../* Cal|
|00001bb0| 6c 65 64 20 77 68 65 6e | 20 74 68 65 20 75 73 65 |led when| the use|
|00001bc0| 72 20 73 65 6c 65 63 74 | 73 20 22 53 61 76 65 22 |r select|s "Save"|
|00001bd0| 20 66 72 6f 6d 20 74 68 | 65 20 46 69 6c 65 20 6d | from th|e File m|
|00001be0| 65 6e 75 2e 20 52 65 74 | 75 72 6e 73 20 61 20 62 |enu. Ret|urns a b|
|00001bf0| 6f 6f 6c 65 61 6e 20 74 | 68 61 74 20 69 73 20 0d |oolean t|hat is .|
|00001c00| 09 66 61 6c 73 65 20 6f | 6e 6c 79 20 69 66 20 41 |.false o|nly if A|
|00001c10| 70 70 53 61 76 65 41 73 | 28 29 20 69 73 20 63 61 |ppSaveAs|() is ca|
|00001c20| 6c 6c 65 64 20 61 6e 64 | 20 74 68 65 20 75 73 65 |lled and| the use|
|00001c30| 72 20 63 61 6e 63 65 6c | 73 20 74 68 65 20 73 61 |r cancel|s the sa|
|00001c40| 76 65 2c 20 6f 72 20 69 | 66 20 74 68 65 72 65 20 |ve, or i|f there |
|00001c50| 69 73 20 61 6e 0d 09 65 | 72 72 6f 72 2e 20 2a 2f |is an..e|rror. */|
|00001c60| 0d 42 6f 6f 6c 65 61 6e | 09 41 70 70 53 61 76 65 |.Boolean|.AppSave|
|00001c70| 28 57 69 6e 64 6f 77 50 | 74 72 20 77 69 6e 64 29 |(WindowP|tr wind)|
|00001c80| 0d 7b 0d 09 4f 53 45 72 | 72 09 09 09 65 72 72 20 |.{..OSEr|r...err |
|00001c90| 3d 20 6e 6f 45 72 72 3b | 0d 09 42 6f 6f 6c 65 61 |= noErr;|..Boolea|
|00001ca0| 6e 09 09 09 73 75 63 63 | 65 73 73 20 3d 20 74 72 |n...succ|ess = tr|
|00001cb0| 75 65 3b 0d 09 4a 75 67 | 67 6c 65 48 61 6e 64 6c |ue;..Jug|gleHandl|
|00001cc0| 65 09 61 4a 75 67 67 6c | 65 3b 0d 0d 09 2f 2a 20 |e.aJuggl|e;.../* |
|00001cd0| 47 65 74 20 74 68 65 20 | 6a 75 67 67 6c 65 20 69 |Get the |juggle i|
|00001ce0| 6e 20 71 75 65 73 74 69 | 6f 6e 20 2a 2f 0d 09 61 |n questi|on */..a|
|00001cf0| 4a 75 67 67 6c 65 20 3d | 20 47 65 74 57 69 6e 64 |Juggle =| GetWind|
|00001d00| 6f 77 4a 75 67 67 6c 65 | 28 77 69 6e 64 29 3b 0d |owJuggle|(wind);.|
|00001d10| 09 69 66 28 61 4a 75 67 | 67 6c 65 20 3d 3d 20 6e |.if(aJug|gle == n|
|00001d20| 69 6c 29 0d 09 09 72 65 | 74 75 72 6e 20 74 72 75 |il)...re|turn tru|
|00001d30| 65 3b 20 2f 2f 20 6d 65 | 61 6e 73 20 22 63 61 6e |e; // me|ans "can|
|00001d40| 63 65 6c 6c 65 64 22 0d | 09 09 0d 09 2f 2a 20 43 |celled".|..../* C|
|00001d50| 68 65 63 6b 20 74 68 65 | 20 66 69 6c 65 20 6e 61 |heck the| file na|
|00001d60| 6d 65 20 69 6e 20 6f 75 | 72 20 77 69 6e 64 6f 77 |me in ou|r window|
|00001d70| 27 73 20 73 70 65 63 2e | 20 49 66 20 65 6d 70 74 |'s spec.| If empt|
|00001d80| 79 2c 20 64 6f 20 73 61 | 76 65 20 61 73 2c 20 65 |y, do sa|ve as, e|
|00001d90| 6c 73 65 20 73 61 76 65 | 20 2a 2f 0d 09 69 66 28 |lse save| */..if(|
|00001da0| 28 2a 61 4a 75 67 67 6c | 65 29 2d 3e 66 69 6c 65 |(*aJuggl|e)->file|
|00001db0| 53 70 65 63 2e 6e 61 6d | 65 5b 30 5d 20 3d 3d 20 |Spec.nam|e[0] == |
|00001dc0| 30 29 0d 09 7b 0d 09 09 | 73 75 63 63 65 73 73 20 |0)..{...|success |
|00001dd0| 3d 20 41 70 70 53 61 76 | 65 41 73 28 77 69 6e 64 |= AppSav|eAs(wind|
|00001de0| 29 3b 0d 09 7d 0d 09 65 | 6c 73 65 09 2f 2a 20 61 |);..}..e|lse./* a|
|00001df0| 20 72 65 67 75 6c 61 72 | 20 73 61 76 65 2c 20 69 | regular| save, i|
|00001e00| 74 27 73 20 62 65 65 6e | 20 73 61 76 65 64 20 62 |t's been| saved b|
|00001e10| 65 66 6f 72 65 20 2a 2f | 0d 09 7b 0d 09 09 2f 2a |efore */|..{.../*|
|00001e20| 20 57 72 69 74 65 20 74 | 68 65 20 64 61 74 61 20 | Write t|he data |
|00001e30| 74 6f 20 74 68 65 20 66 | 69 6c 65 20 2a 2f 0d 09 |to the f|ile */..|
|00001e40| 09 65 72 72 20 3d 20 53 | 61 76 65 4a 75 67 67 6c |.err = S|aveJuggl|
|00001e50| 65 28 61 4a 75 67 67 6c | 65 29 3b 0d 09 09 0d 09 |e(aJuggl|e);.....|
|00001e60| 09 2f 2a 20 49 74 27 73 | 20 70 6f 73 73 69 62 6c |./* It's| possibl|
|00001e70| 65 20 74 68 61 74 20 74 | 68 65 20 75 73 65 72 20 |e that t|he user |
|00001e80| 73 77 69 74 63 68 65 64 | 20 74 6f 20 74 68 65 20 |switched| to the |
|00001e90| 66 69 6e 64 65 72 20 61 | 6e 64 20 64 65 6c 65 74 |finder a|nd delet|
|00001ea0| 65 64 20 74 68 65 0d 09 | 09 09 66 69 6c 65 20 6f |ed the..|..file o|
|00001eb0| 72 20 65 6a 65 63 74 65 | 64 20 74 68 65 20 64 69 |r ejecte|d the di|
|00001ec0| 73 6b 20 69 74 27 73 20 | 6f 6e 2c 20 73 6f 20 6c |sk it's |on, so l|
|00001ed0| 65 74 27 73 20 63 68 65 | 63 6b 20 74 68 65 20 65 |et's che|ck the e|
|00001ee0| 72 72 6f 72 2e 20 49 66 | 20 69 74 27 73 20 0d 09 |rror. If| it's ..|
|00001ef0| 09 09 66 6e 66 45 72 72 | 20 6f 72 20 6e 73 76 45 |..fnfErr| or nsvE|
|00001f00| 72 72 2c 20 64 6f 20 61 | 20 53 61 76 65 41 73 20 |rr, do a| SaveAs |
|00001f10| 2a 2f 0d 09 09 69 66 28 | 65 72 72 20 3d 3d 20 66 |*/...if(|err == f|
|00001f20| 6e 66 45 72 72 20 7c 7c | 20 65 72 72 20 3d 3d 20 |nfErr ||| err == |
|00001f30| 6e 73 76 45 72 72 29 0d | 09 09 7b 0d 09 09 09 65 |nsvErr).|..{....e|
|00001f40| 72 72 20 3d 20 6e 6f 45 | 72 72 3b 0d 09 09 09 73 |rr = noE|rr;....s|
|00001f50| 75 63 63 65 73 73 20 3d | 20 41 70 70 53 61 76 65 |uccess =| AppSave|
|00001f60| 41 73 28 77 69 6e 64 29 | 3b 0d 09 09 7d 0d 09 09 |As(wind)|;...}...|
|00001f70| 0d 09 09 69 66 28 65 72 | 72 20 3d 3d 20 6e 6f 45 |...if(er|r == noE|
|00001f80| 72 72 29 0d 09 09 09 2f | 2a 20 53 75 63 63 65 73 |rr)..../|* Succes|
|00001f90| 73 66 75 6c 20 73 61 76 | 65 2c 20 73 6f 20 73 65 |sful sav|e, so se|
|00001fa0| 74 20 64 69 72 74 79 20 | 66 6c 61 67 20 74 6f 20 |t dirty |flag to |
|00001fb0| 66 61 6c 73 65 20 2a 2f | 0d 09 09 09 28 2a 61 4a |false */|....(*aJ|
|00001fc0| 75 67 67 6c 65 29 2d 3e | 64 69 72 74 79 20 3d 20 |uggle)->|dirty = |
|00001fd0| 66 61 6c 73 65 3b 0d 09 | 09 65 6c 73 65 0d 09 09 |false;..|.else...|
|00001fe0| 7b 0d 09 09 09 73 75 63 | 63 65 73 73 20 3d 20 66 |{....suc|cess = f|
|00001ff0| 61 6c 73 65 3b 0d 2f 2f | 09 09 09 53 79 73 42 65 |alse;.//|...SysBe|
|00002000| 65 70 28 31 30 29 3b 0d | 09 09 7d 0d 09 7d 0d 09 |ep(10);.|..}..}..|
|00002010| 72 65 74 75 72 6e 20 73 | 75 63 63 65 73 73 3b 0d |return s|uccess;.|
|00002020| 7d 0d 0d 2f 2a 20 43 61 | 6c 6c 65 64 20 77 68 65 |}../* Ca|lled whe|
|00002030| 6e 20 74 68 65 20 75 73 | 65 72 20 73 65 6c 65 63 |n the us|er selec|
|00002040| 74 73 20 22 53 61 76 65 | 20 41 73 2e 2e 2e 22 20 |ts "Save| As..." |
|00002050| 66 72 6f 6d 20 74 68 65 | 20 46 69 6c 65 20 6d 65 |from the| File me|
|00002060| 6e 75 2e 20 52 65 74 75 | 72 6e 73 20 61 20 62 6f |nu. Retu|rns a bo|
|00002070| 6f 6c 65 61 6e 20 74 68 | 61 74 20 0d 09 69 73 20 |olean th|at ..is |
|00002080| 74 72 75 65 20 69 66 20 | 74 68 65 20 73 61 76 65 |true if |the save|
|00002090| 20 65 6e 64 73 20 73 75 | 63 63 65 73 73 66 75 6c | ends su|ccessful|
|000020a0| 79 20 2a 2f 0d 42 6f 6f | 6c 65 61 6e 09 41 70 70 |y */.Boo|lean.App|
|000020b0| 53 61 76 65 41 73 28 57 | 69 6e 64 6f 77 50 74 72 |SaveAs(W|indowPtr|
|000020c0| 20 77 69 6e 64 29 0d 7b | 0d 09 53 74 72 32 35 35 | wind).{|..Str255|
|000020d0| 09 09 09 09 74 69 74 6c | 65 2c 20 70 72 6f 6d 70 |....titl|e, promp|
|000020e0| 74 20 3d 20 22 5c 70 53 | 61 76 65 20 74 68 69 73 |t = "\pS|ave this|
|000020f0| 20 70 61 74 74 65 72 6e | 20 61 73 3a 22 3b 0d 09 | pattern| as:";..|
|00002100| 53 74 61 6e 64 61 72 64 | 46 69 6c 65 52 65 70 6c |Standard|FileRepl|
|00002110| 79 09 72 65 70 6c 79 3b | 0d 09 4f 53 45 72 72 09 |y.reply;|..OSErr.|
|00002120| 09 09 09 65 72 72 20 3d | 20 6e 6f 45 72 72 3b 0d |...err =| noErr;.|
|00002130| 09 42 6f 6f 6c 65 61 6e | 09 09 09 09 73 75 63 63 |.Boolean|....succ|
|00002140| 65 73 73 20 3d 20 66 61 | 6c 73 65 3b 0d 09 4a 75 |ess = fa|lse;..Ju|
|00002150| 67 67 6c 65 48 61 6e 64 | 6c 65 09 09 61 4a 75 67 |ggleHand|le..aJug|
|00002160| 67 6c 65 3b 0d 0d 09 2f | 2a 20 47 65 74 20 74 68 |gle;.../|* Get th|
|00002170| 65 20 6a 75 67 67 6c 65 | 20 69 6e 20 71 75 65 73 |e juggle| in ques|
|00002180| 74 69 6f 6e 20 2a 2f 0d | 09 61 4a 75 67 67 6c 65 |tion */.|.aJuggle|
|00002190| 20 3d 20 47 65 74 57 69 | 6e 64 6f 77 4a 75 67 67 | = GetWi|ndowJugg|
|000021a0| 6c 65 28 77 69 6e 64 29 | 3b 0d 09 69 66 28 61 4a |le(wind)|;..if(aJ|
|000021b0| 75 67 67 6c 65 20 3d 3d | 20 6e 69 6c 29 0d 09 09 |uggle ==| nil)...|
|000021c0| 72 65 74 75 72 6e 20 74 | 72 75 65 3b 20 2f 2f 20 |return t|rue; // |
|000021d0| 21 21 21 0d 09 09 0d 09 | 2f 2f 20 47 65 74 20 74 |!!!.....|// Get t|
|000021e0| 68 65 20 74 69 74 6c 65 | 0d 09 47 65 74 57 54 69 |he title|..GetWTi|
|000021f0| 74 6c 65 28 77 69 6e 64 | 2c 20 74 69 74 6c 65 29 |tle(wind|, title)|
|00002200| 3b 0d 0d 09 2f 2a 20 70 | 75 74 20 75 70 20 53 74 |;.../* p|ut up St|
|00002210| 61 6e 64 61 72 64 20 46 | 69 6c 65 20 44 69 61 6c |andard F|ile Dial|
|00002220| 6f 67 20 2a 2f 0d 09 53 | 74 61 6e 64 61 72 64 50 |og */..S|tandardP|
|00002230| 75 74 46 69 6c 65 28 70 | 72 6f 6d 70 74 2c 20 74 |utFile(p|rompt, t|
|00002240| 69 74 6c 65 2c 20 20 26 | 72 65 70 6c 79 29 3b 0d |itle, &|reply);.|
|00002250| 09 0d 09 2f 2a 20 49 66 | 20 75 73 65 72 20 63 6c |.../* If| user cl|
|00002260| 69 63 6b 65 64 20 53 61 | 76 65 2c 20 64 6f 20 69 |icked Sa|ve, do i|
|00002270| 74 20 2a 2f 0d 09 69 66 | 28 72 65 70 6c 79 2e 73 |t */..if|(reply.s|
|00002280| 66 47 6f 6f 64 20 3d 3d | 20 74 72 75 65 29 0d 09 |fGood ==| true)..|
|00002290| 7b 0d 09 09 2f 2a 20 49 | 66 20 77 65 20 61 72 65 |{.../* I|f we are|
|000022a0| 20 72 65 70 6c 61 63 69 | 6e 67 20 61 6e 20 65 78 | replaci|ng an ex|
|000022b0| 69 73 74 69 6e 67 20 66 | 69 6c 65 2c 20 77 65 20 |isting f|ile, we |
|000022c0| 63 61 6c 6c 20 6f 6e 65 | 20 72 6f 75 74 69 6e 65 |call one| routine|
|000022d0| 2c 20 69 66 20 77 65 20 | 61 72 65 20 0d 09 09 09 |, if we |are ....|
|000022e0| 63 72 65 61 74 69 6e 67 | 20 61 20 6e 65 77 20 6f |creating| a new o|
|000022f0| 6e 65 2c 20 61 6e 6f 74 | 68 65 72 20 72 6f 75 74 |ne, anot|her rout|
|00002300| 69 6e 65 20 2a 2f 0d 09 | 09 69 66 28 72 65 70 6c |ine */..|.if(repl|
|00002310| 79 2e 73 66 52 65 70 6c | 61 63 69 6e 67 29 0d 09 |y.sfRepl|acing)..|
|00002320| 09 09 65 72 72 20 3d 20 | 4a 75 67 67 6c 65 54 6f |..err = |JuggleTo|
|00002330| 45 78 69 73 74 69 6e 67 | 46 69 6c 65 28 26 72 65 |Existing|File(&re|
|00002340| 70 6c 79 2e 73 66 46 69 | 6c 65 2c 20 61 4a 75 67 |ply.sfFi|le, aJug|
|00002350| 67 6c 65 29 3b 0d 09 09 | 65 6c 73 65 0d 09 09 09 |gle);...|else....|
|00002360| 65 72 72 20 3d 20 4a 75 | 67 67 6c 65 54 6f 4e 65 |err = Ju|ggleToNe|
|00002370| 77 46 69 6c 65 28 26 72 | 65 70 6c 79 2e 73 66 46 |wFile(&r|eply.sfF|
|00002380| 69 6c 65 2c 20 61 4a 75 | 67 67 6c 65 29 3b 0d 09 |ile, aJu|ggle);..|
|00002390| 09 0d 09 09 69 66 28 65 | 72 72 20 3d 3d 20 6e 6f |....if(e|rr == no|
|000023a0| 45 72 72 29 0d 09 09 7b | 0d 09 09 09 2f 2a 09 53 |Err)...{|..../*.S|
|000023b0| 75 63 63 65 73 73 66 75 | 6c 20 73 61 76 65 2c 20 |uccessfu|l save, |
|000023c0| 73 6f 20 72 65 6e 61 6d | 65 20 74 68 65 20 77 69 |so renam|e the wi|
|000023d0| 6e 64 6f 77 2c 20 61 6e | 64 20 73 65 74 20 74 68 |ndow, an|d set th|
|000023e0| 65 20 64 69 72 74 79 20 | 66 6c 61 67 20 2a 2f 0d |e dirty |flag */.|
|000023f0| 09 09 09 53 65 74 57 54 | 69 74 6c 65 28 77 69 6e |...SetWT|itle(win|
|00002400| 64 2c 20 72 65 70 6c 79 | 2e 73 66 46 69 6c 65 2e |d, reply|.sfFile.|
|00002410| 6e 61 6d 65 29 3b 0d 09 | 09 09 28 2a 61 4a 75 67 |name);..|..(*aJug|
|00002420| 67 6c 65 29 2d 3e 64 69 | 72 74 79 20 3d 20 66 61 |gle)->di|rty = fa|
|00002430| 6c 73 65 3b 0d 0d 09 09 | 09 2f 2f 20 53 61 76 65 |lse;....|.// Save|
|00002440| 20 74 68 65 20 6e 65 77 | 20 66 69 6c 65 20 69 6e | the new| file in|
|00002450| 20 74 68 65 20 6a 75 67 | 67 6c 65 2c 20 61 6e 64 | the jug|gle, and|
|00002460| 20 73 69 67 6e 61 6c 20 | 73 75 63 63 65 73 73 0d | signal |success.|
|00002470| 09 09 09 28 2a 61 4a 75 | 67 67 6c 65 29 2d 3e 66 |...(*aJu|ggle)->f|
|00002480| 69 6c 65 53 70 65 63 20 | 3d 20 72 65 70 6c 79 2e |ileSpec |= reply.|
|00002490| 73 66 46 69 6c 65 3b 0d | 09 09 09 73 75 63 63 65 |sfFile;.|...succe|
|000024a0| 73 73 20 3d 20 74 72 75 | 65 3b 0d 09 09 7d 0d 09 |ss = tru|e;...}..|
|000024b0| 7d 0d 09 0d 09 72 65 74 | 75 72 6e 20 73 75 63 63 |}....ret|urn succ|
|000024c0| 65 73 73 3b 0d 7d 0d 0d | 2f 2f 20 20 43 61 6c 6c |ess;.}..|// Call|
|000024d0| 65 64 20 77 68 65 6e 20 | 74 68 65 20 75 73 65 72 |ed when |the user|
|000024e0| 20 73 65 6c 65 63 74 73 | 20 22 50 61 67 65 20 53 | selects| "Page S|
|000024f0| 65 74 75 70 2e 2e 2e 22 | 20 66 72 6f 6d 20 74 68 |etup..."| from th|
|00002500| 65 20 46 69 6c 65 20 6d | 65 6e 75 2e 20 0d 76 6f |e File m|enu. .vo|
|00002510| 69 64 20 41 70 70 50 61 | 67 65 53 65 74 75 70 28 |id AppPa|geSetup(|
|00002520| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 29 0d |WindowPt|r wind).|
|00002530| 7b 0d 09 67 78 44 69 61 | 6c 6f 67 52 65 73 75 6c |{..gxDia|logResul|
|00002540| 74 09 72 65 73 75 6c 74 | 3b 0d 09 0d 09 69 66 28 |t.result|;....if(|
|00002550| 77 69 6e 64 20 3d 3d 20 | 6e 69 6c 29 0d 09 09 72 |wind == |nil)...r|
|00002560| 65 74 75 72 6e 3b 0d 09 | 44 6f 47 58 46 6f 72 6d |eturn;..|DoGXForm|
|00002570| 61 74 44 69 61 6c 6f 67 | 28 77 69 6e 64 2c 20 26 |atDialog|(wind, &|
|00002580| 72 65 73 75 6c 74 29 3b | 0d 7d 0d 0d 2f 2f 20 20 |result);|.}..// |
|00002590| 43 61 6c 6c 65 64 20 77 | 68 65 6e 20 74 68 65 20 |Called w|hen the |
|000025a0| 75 73 65 72 20 73 65 6c | 65 63 74 73 20 22 50 72 |user sel|ects "Pr|
|000025b0| 69 6e 74 c9 22 20 66 72 | 6f 6d 20 74 68 65 20 46 |int." fr|om the F|
|000025c0| 69 6c 65 20 6d 65 6e 75 | 2e 20 0d 4f 53 45 72 72 |ile menu|. .OSErr|
|000025d0| 20 41 70 70 50 72 69 6e | 74 28 57 69 6e 64 6f 77 | AppPrin|t(Window|
|000025e0| 50 74 72 20 77 69 6e 64 | 29 0d 7b 0d 09 69 66 28 |Ptr wind|).{..if(|
|000025f0| 77 69 6e 64 20 3d 3d 20 | 6e 69 6c 29 0d 09 09 72 |wind == |nil)...r|
|00002600| 65 74 75 72 6e 20 2d 31 | 3b 0d 09 72 65 74 75 72 |eturn -1|;..retur|
|00002610| 6e 20 44 6f 47 58 50 72 | 69 6e 74 69 6e 67 28 77 |n DoGXPr|inting(w|
|00002620| 69 6e 64 29 3b 0d 7d 0d | 0d 2f 2f 20 20 43 61 6c |ind);.}.|.// Cal|
|00002630| 6c 65 64 20 77 68 65 6e | 20 74 68 65 20 75 73 65 |led when| the use|
|00002640| 72 20 73 65 6c 65 63 74 | 73 20 22 50 72 69 6e 74 |r select|s "Print|
|00002650| 20 4f 6e 65 22 20 66 72 | 6f 6d 20 74 68 65 20 46 | One" fr|om the F|
|00002660| 69 6c 65 20 6d 65 6e 75 | 2e 20 0d 4f 53 45 72 72 |ile menu|. .OSErr|
|00002670| 20 41 70 70 50 72 69 6e | 74 4f 6e 65 28 57 69 6e | AppPrin|tOne(Win|
|00002680| 64 6f 77 50 74 72 20 77 | 69 6e 64 29 0d 7b 0d 09 |dowPtr w|ind).{..|
|00002690| 67 78 53 68 61 70 65 09 | 09 09 70 61 67 65 53 68 |gxShape.|..pageSh|
|000026a0| 61 70 65 3b 0d 09 4f 53 | 45 72 72 09 09 09 65 72 |ape;..OS|Err...er|
|000026b0| 72 20 3d 20 2d 31 3b 09 | 2f 2f 20 61 73 73 75 6d |r = -1;.|// assum|
|000026c0| 65 20 66 61 69 6c 75 72 | 65 0d 09 4a 75 67 67 6c |e failur|e..Juggl|
|000026d0| 65 48 61 6e 64 6c 65 09 | 61 4a 75 67 67 6c 65 3b |eHandle.|aJuggle;|
|000026e0| 0d 09 0d 09 2f 2a 20 47 | 65 74 20 74 68 65 20 6a |..../* G|et the j|
|000026f0| 75 67 67 6c 65 20 69 6e | 20 71 75 65 73 74 69 6f |uggle in| questio|
|00002700| 6e 20 2a 2f 0d 09 61 4a | 75 67 67 6c 65 20 3d 20 |n */..aJ|uggle = |
|00002710| 47 65 74 57 69 6e 64 6f | 77 4a 75 67 67 6c 65 28 |GetWindo|wJuggle(|
|00002720| 77 69 6e 64 29 3b 0d 09 | 69 66 28 61 4a 75 67 67 |wind);..|if(aJugg|
|00002730| 6c 65 20 3d 3d 20 6e 69 | 6c 29 0d 09 09 72 65 74 |le == ni|l)...ret|
|00002740| 75 72 6e 20 65 72 72 3b | 0d 09 0d 09 2f 2f 20 4d |urn err;|....// M|
|00002750| 61 6b 65 20 61 20 70 61 | 67 65 20 74 6f 20 70 72 |ake a pa|ge to pr|
|00002760| 69 6e 74 0d 09 70 61 67 | 65 53 68 61 70 65 20 3d |int..pag|eShape =|
|00002770| 20 4d 61 6b 65 50 72 69 | 6e 74 69 6e 67 53 68 61 | MakePri|ntingSha|
|00002780| 70 65 28 61 4a 75 67 67 | 6c 65 29 3b 0d 09 69 66 |pe(aJugg|le);..if|
|00002790| 28 70 61 67 65 53 68 61 | 70 65 20 21 3d 20 6e 69 |(pageSha|pe != ni|
|000027a0| 6c 29 0d 09 7b 0d 09 09 | 2f 2f 20 43 61 6c 6c 20 |l)..{...|// Call |
|000027b0| 74 68 65 20 73 68 65 6c | 6c 20 74 6f 20 70 72 69 |the shel|l to pri|
|000027c0| 6e 74 20 69 74 0d 09 09 | 65 72 72 20 3d 20 44 6f |nt it...|err = Do|
|000027d0| 47 58 50 72 69 6e 74 4f | 6e 65 28 77 69 6e 64 2c |GXPrintO|ne(wind,|
|000027e0| 20 70 61 67 65 53 68 61 | 70 65 29 3b 0d 09 0d 09 | pageSha|pe);....|
|000027f0| 09 2f 2f 20 43 6c 65 61 | 6e 20 75 70 0d 09 09 47 |.// Clea|n up...G|
|00002800| 58 44 69 73 70 6f 73 65 | 53 68 61 70 65 28 70 61 |XDispose|Shape(pa|
|00002810| 67 65 53 68 61 70 65 29 | 3b 0d 09 7d 0d 09 0d 09 |geShape)|;..}....|
|00002820| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 7d 0d 0d 2f |return e|rr;.}../|
|00002830| 2f 20 20 43 61 6c 6c 65 | 64 20 77 68 65 6e 20 74 |/ Calle|d when t|
|00002840| 68 65 20 75 73 65 72 20 | 73 65 6c 65 63 74 73 20 |he user |selects |
|00002850| 22 55 6e 64 6f 22 20 66 | 72 6f 6d 20 74 68 65 20 |"Undo" f|rom the |
|00002860| 45 64 69 74 20 6d 65 6e | 75 2e 20 0d 76 6f 69 64 |Edit men|u. .void|
|00002870| 20 41 70 70 55 6e 64 6f | 28 76 6f 69 64 29 0d 7b | AppUndo|(void).{|
|00002880| 0d 7d 0d 0d 2f 2f 20 20 | 43 61 6c 6c 65 64 20 77 |.}..// |Called w|
|00002890| 68 65 6e 20 74 68 65 20 | 75 73 65 72 20 73 65 6c |hen the |user sel|
|000028a0| 65 63 74 73 20 22 43 75 | 74 22 20 66 72 6f 6d 20 |ects "Cu|t" from |
|000028b0| 74 68 65 20 45 64 69 74 | 20 6d 65 6e 75 2e 20 0d |the Edit| menu. .|
|000028c0| 76 6f 69 64 20 41 70 70 | 43 75 74 28 76 6f 69 64 |void App|Cut(void|
|000028d0| 29 0d 7b 0d 7d 0d 0d 2f | 2f 20 20 43 61 6c 6c 65 |).{.}../|/ Calle|
|000028e0| 64 20 77 68 65 6e 20 74 | 68 65 20 75 73 65 72 20 |d when t|he user |
|000028f0| 73 65 6c 65 63 74 73 20 | 22 43 6f 70 79 22 20 66 |selects |"Copy" f|
|00002900| 72 6f 6d 20 74 68 65 20 | 45 64 69 74 20 6d 65 6e |rom the |Edit men|
|00002910| 75 2e 20 0d 4f 53 45 72 | 72 20 41 70 70 43 6f 70 |u. .OSEr|r AppCop|
|00002920| 79 28 76 6f 69 64 29 0d | 7b 0d 09 72 65 74 75 72 |y(void).|{..retur|
|00002930| 6e 20 6e 6f 45 72 72 3b | 0d 7d 09 09 09 0d 09 09 |n noErr;|.}......|
|00002940| 09 0d 2f 2f 20 20 43 61 | 6c 6c 65 64 20 77 68 65 |..// Ca|lled whe|
|00002950| 6e 20 74 68 65 20 75 73 | 65 72 20 73 65 6c 65 63 |n the us|er selec|
|00002960| 74 73 20 22 50 61 73 74 | 65 22 20 66 72 6f 6d 20 |ts "Past|e" from |
|00002970| 74 68 65 20 45 64 69 74 | 20 6d 65 6e 75 2e 20 0d |the Edit| menu. .|
|00002980| 76 6f 69 64 20 41 70 70 | 50 61 73 74 65 28 76 6f |void App|Paste(vo|
|00002990| 69 64 29 0d 7b 0d 7d 0d | 0d 2f 2f 20 20 43 61 6c |id).{.}.|.// Cal|
|000029a0| 6c 65 64 20 77 68 65 6e | 20 74 68 65 20 75 73 65 |led when| the use|
|000029b0| 72 20 73 65 6c 65 63 74 | 73 20 22 43 6c 65 61 72 |r select|s "Clear|
|000029c0| 22 20 66 72 6f 6d 20 74 | 68 65 20 45 64 69 74 20 |" from t|he Edit |
|000029d0| 6d 65 6e 75 2e 20 0d 76 | 6f 69 64 20 41 70 70 43 |menu. .v|oid AppC|
|000029e0| 6c 65 61 72 28 76 6f 69 | 64 29 0d 7b 0d 7d 0d 0d |lear(voi|d).{.}..|
|000029f0| 2f 2f 20 20 43 61 6c 6c | 65 64 20 77 68 65 6e 20 |// Call|ed when |
|00002a00| 74 68 65 20 73 68 65 6c | 6c 20 69 73 20 61 62 6f |the shel|l is abo|
|00002a10| 75 74 20 74 6f 20 71 75 | 69 74 2c 20 73 61 76 69 |ut to qu|it, savi|
|00002a20| 6e 67 20 68 61 73 20 61 | 6c 72 65 61 64 79 20 68 |ng has a|lready h|
|00002a30| 61 70 70 65 6e 65 64 2e | 20 0d 76 6f 69 64 20 41 |appened.| .void A|
|00002a40| 70 70 43 6c 65 61 6e 55 | 70 28 76 6f 69 64 29 0d |ppCleanU|p(void).|
|00002a50| 7b 0d 09 57 69 6e 64 6f | 77 50 74 72 09 77 69 6e |{..Windo|wPtr.win|
|00002a60| 64 3b 0d 09 0d 09 2f 2f | 20 20 43 6c 6f 73 65 20 |d;....//| Close |
|00002a70| 61 6e 79 20 77 69 6e 64 | 6f 77 73 20 28 61 73 73 |any wind|ows (ass|
|00002a80| 75 6d 65 64 20 61 6c 72 | 65 61 64 79 20 73 61 76 |umed alr|eady sav|
|00002a90| 65 64 2c 20 69 66 20 6e | 65 63 65 73 73 61 72 79 |ed, if n|ecessary|
|00002aa0| 29 2c 0d 09 2f 2f 20 77 | 68 69 63 68 20 61 6c 73 |),..// w|hich als|
|00002ab0| 6f 20 6b 69 6c 6c 73 20 | 74 68 65 20 73 63 72 6f |o kills |the scro|
|00002ac0| 6c 6c 42 61 72 73 20 0d | 09 77 68 69 6c 65 28 28 |llBars .|.while((|
|00002ad0| 77 69 6e 64 20 3d 20 46 | 72 6f 6e 74 57 69 6e 64 |wind = F|rontWind|
|00002ae0| 6f 77 28 29 29 20 21 3d | 20 6e 69 6c 29 0d 09 09 |ow()) !=| nil)...|
|00002af0| 41 70 70 43 6c 6f 73 65 | 28 77 69 6e 64 29 3b 0d |AppClose|(wind);.|
|00002b00| 09 0d 09 2f 2f 20 49 66 | 20 47 58 20 69 73 20 61 |...// If| GX is a|
|00002b10| 63 74 69 76 65 2c 20 6b | 69 6c 6c 20 69 74 0d 09 |ctive, k|ill it..|
|00002b20| 69 66 28 67 47 72 61 70 | 68 69 63 73 43 6c 69 65 |if(gGrap|hicsClie|
|00002b30| 6e 74 20 21 3d 20 6e 69 | 6c 29 0d 09 7b 0d 09 09 |nt != ni|l)..{...|
|00002b40| 2f 2f 20 43 6c 65 61 6e | 20 75 70 20 74 68 65 20 |// Clean| up the |
|00002b50| 67 6c 6f 62 61 6c 20 6f | 62 6a 65 63 74 73 0d 09 |global o|bjects..|
|00002b60| 09 4b 69 6c 6c 43 6f 6d | 6d 6f 6e 47 72 61 70 68 |.KillCom|monGraph|
|00002b70| 69 63 4f 62 6a 65 63 74 | 73 28 29 3b 0d 09 09 54 |icObject|s();...T|
|00002b80| 65 61 72 44 6f 77 6e 47 | 58 28 29 3b 0d 09 09 67 |earDownG|X();...g|
|00002b90| 47 72 61 70 68 69 63 73 | 43 6c 69 65 6e 74 20 3d |Graphics|Client =|
|00002ba0| 20 6e 69 6c 3b 0d 09 7d | 0d 7d 0d 0d 42 6f 6f 6c | nil;..}|.}..Bool|
|00002bb0| 65 61 6e 20 53 65 74 55 | 70 47 58 28 76 6f 69 64 |ean SetU|pGX(void|
|00002bc0| 29 0d 7b 0d 09 42 6f 6f | 6c 65 61 6e 20 72 65 73 |).{..Boo|lean res|
|00002bd0| 75 6c 74 20 3d 20 66 61 | 6c 73 65 3b 20 2f 2f 20 |ult = fa|lse; // |
|00002be0| 61 73 73 75 6d 65 20 66 | 61 69 6c 75 72 65 0d 09 |assume f|ailure..|
|00002bf0| 0d 09 2f 2f 20 54 68 65 | 20 47 58 4e 65 77 47 72 |..// The| GXNewGr|
|00002c00| 61 70 68 69 63 73 43 6c | 69 65 6e 74 20 72 6f 75 |aphicsCl|ient rou|
|00002c10| 74 69 6e 65 20 64 65 66 | 69 6e 65 73 20 74 68 65 |tine def|ines the|
|00002c20| 20 67 72 61 70 68 69 63 | 73 20 68 65 61 70 20 73 | graphic|s heap s|
|00002c30| 69 7a 65 2e 20 20 49 66 | 20 79 6f 75 20 64 6f 20 |ize. If| you do |
|00002c40| 6e 6f 74 20 6d 61 6b 65 | 20 74 68 69 73 0d 09 2f |not make| this../|
|00002c50| 2f 20 63 61 6c 6c 2c 20 | 74 68 65 20 47 58 20 67 |/ call, |the GX g|
|00002c60| 72 61 70 68 69 63 73 20 | 65 6e 67 69 6e 65 20 77 |raphics |engine w|
|00002c70| 69 6c 6c 20 63 72 65 61 | 74 65 20 74 68 69 73 20 |ill crea|te this |
|00002c80| 68 65 61 70 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |heap aut|omatical|
|00002c90| 6c 79 2e 20 20 48 6f 77 | 3f 20 20 49 74 20 77 69 |ly. How|? It wi|
|00002ca0| 6c 6c 20 63 72 65 61 74 | 65 0d 09 2f 2f 20 61 20 |ll creat|e..// a |
|00002cb0| 68 65 61 70 20 77 68 69 | 63 68 20 69 73 20 61 20 |heap whi|ch is a |
|00002cc0| 70 65 72 63 65 6e 74 61 | 67 65 20 6f 66 20 79 6f |percenta|ge of yo|
|00002cd0| 75 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 27 73 |ur appli|cation's|
|00002ce0| 20 69 64 65 61 6c 20 6d | 65 6d 6f 72 79 20 66 6f | ideal m|emory fo|
|00002cf0| 6f 74 20 70 72 69 6e 74 | 2e 20 20 54 68 69 73 20 |ot print|. This |
|00002d00| 63 61 6c 6c 0d 09 2f 2f | 20 61 6c 6c 6f 77 73 20 |call..//| allows |
|00002d10| 79 6f 75 20 74 6f 20 65 | 78 70 6c 69 63 69 74 79 |you to e|xplicity|
|00002d20| 20 64 65 66 69 6e 65 20 | 74 68 65 20 61 6d 6d 6f | define |the ammo|
|00002d30| 75 6e 74 20 6f 66 20 6d | 65 6d 6f 72 79 20 75 73 |unt of m|emory us|
|00002d40| 65 64 20 62 79 20 74 68 | 65 20 67 72 61 70 68 69 |ed by th|e graphi|
|00002d50| 63 73 20 73 79 73 74 65 | 6d 20 66 6f 72 0d 09 2f |cs syste|m for../|
|00002d60| 2f 20 69 74 73 20 67 72 | 61 70 68 69 63 73 20 6f |/ its gr|aphics o|
|00002d70| 62 6a 65 63 74 73 20 68 | 65 61 70 2e 0d 0d 09 67 |bjects h|eap....g|
|00002d80| 47 72 61 70 68 69 63 73 | 43 6c 69 65 6e 74 20 3d |Graphics|Client =|
|00002d90| 20 47 58 4e 65 77 47 72 | 61 70 68 69 63 73 43 6c | GXNewGr|aphicsCl|
|00002da0| 69 65 6e 74 28 6e 69 6c | 2c 20 67 47 72 61 70 68 |ient(nil|, gGraph|
|00002db0| 69 63 73 48 65 61 70 53 | 69 7a 65 20 2a 20 31 30 |icsHeapS|ize * 10|
|00002dc0| 32 34 2c 20 30 4c 29 3b | 0d 0d 09 69 66 20 28 20 |24, 0L);|...if ( |
|00002dd0| 67 47 72 61 70 68 69 63 | 73 43 6c 69 65 6e 74 20 |gGraphic|sClient |
|00002de0| 29 0d 09 7b 0d 09 09 2f | 2f 20 49 66 20 67 44 65 |)..{.../|/ If gDe|
|00002df0| 62 75 67 67 69 6e 67 20 | 3d 20 54 52 55 45 2c 20 |bugging |= TRUE, |
|00002e00| 79 6f 75 20 77 69 6c 6c | 20 72 65 63 65 69 76 65 |you will| receive|
|00002e10| 20 67 72 61 70 68 69 63 | 73 20 6c 69 62 72 61 72 | graphic|s librar|
|00002e20| 79 20 65 72 72 6f 72 73 | 20 26 20 6e 6f 74 69 63 |y errors| & notic|
|00002e30| 65 73 20 77 69 6c 6c 20 | 62 65 20 70 6f 73 74 65 |es will |be poste|
|00002e40| 64 2e 0d 09 09 2f 2f 20 | 54 68 69 73 20 66 75 6e |d....// |This fun|
|00002e50| 63 74 69 6f 6e 61 6c 69 | 74 79 20 77 69 6c 6c 20 |ctionali|ty will |
|00002e60| 6f 6e 6c 79 20 77 6f 72 | 6b 20 77 69 74 68 20 74 |only wor|k with t|
|00002e70| 68 65 20 22 64 65 62 75 | 67 67 69 6e 67 22 20 76 |he "debu|gging" v|
|00002e80| 65 72 73 69 6f 6e 20 6f | 66 20 51 75 69 63 6b 44 |ersion o|f QuickD|
|00002e90| 72 61 77 20 47 58 2e 20 | 20 49 66 20 79 6f 75 0d |raw GX. | If you.|
|00002ea0| 09 09 2f 2f 20 64 6f 6e | 27 74 20 68 61 76 65 20 |..// don|'t have |
|00002eb0| 74 68 65 20 64 65 62 75 | 67 67 69 6e 67 20 76 65 |the debu|gging ve|
|00002ec0| 72 73 69 6f 6e 20 69 6e | 73 74 61 6c 6c 65 64 2c |rsion in|stalled,|
|00002ed0| 20 74 68 65 73 65 20 66 | 75 6e 63 74 69 6f 6e 73 | these f|unctions|
|00002ee0| 20 77 69 6c 6c 20 6e 6f | 74 20 77 6f 72 6b 2e 20 | will no|t work. |
|00002ef0| 0d 09 0d 09 09 69 66 20 | 28 67 44 65 62 75 67 67 |.....if |(gDebugg|
|00002f00| 69 6e 67 29 0d 09 09 7b | 0d 09 09 09 53 65 74 47 |ing)...{|....SetG|
|00002f10| 72 61 70 68 69 63 73 4c | 69 62 72 61 72 79 45 72 |raphicsL|ibraryEr|
|00002f20| 72 6f 72 73 20 28 29 3b | 0d 09 09 09 53 65 74 47 |rors ();|....SetG|
|00002f30| 72 61 70 68 69 63 73 4c | 69 62 72 61 72 79 4e 6f |raphicsL|ibraryNo|
|00002f40| 74 69 63 65 73 28 29 3b | 09 0d 09 09 7d 0d 09 0d |tices();|....}...|
|00002f50| 09 09 2f 2f 20 53 65 74 | 20 67 47 69 76 65 4d 65 |..// Set| gGiveMe|
|00002f60| 56 61 6c 69 64 61 74 69 | 6f 6e 20 74 6f 20 54 52 |Validati|on to TR|
|00002f70| 55 45 20 69 66 20 79 6f | 75 20 77 61 6e 74 20 72 |UE if yo|u want r|
|00002f80| 75 6e 2d 74 69 6d 65 20 | 76 61 6c 69 64 61 74 69 |un-time |validati|
|00002f90| 6f 6e 2e 20 41 73 20 79 | 6f 75 20 69 6e 63 72 65 |on. As y|ou incre|
|00002fa0| 61 73 65 20 74 68 65 20 | 61 6d 6f 75 6e 74 0d 09 |ase the |amount..|
|00002fb0| 09 2f 2f 20 6f 66 20 76 | 61 6c 69 64 61 74 69 6f |.// of v|alidatio|
|00002fc0| 6e 2c 20 54 68 65 20 64 | 72 61 77 69 6e 67 20 73 |n, The d|rawing s|
|00002fd0| 70 65 65 64 20 77 69 6c | 6c 20 53 4c 4f 57 20 64 |peed wil|l SLOW d|
|00002fe0| 6f 77 6e 20 64 75 65 20 | 74 6f 20 61 6c 6c 20 6f |own due |to all o|
|00002ff0| 66 20 74 68 65 20 69 6e | 74 65 72 6e 61 6c 20 63 |f the in|ternal c|
|00003000| 68 65 63 6b 69 6e 67 2e | 20 0d 09 09 09 0d 09 09 |hecking.| .......|
|00003010| 2f 2f 20 67 78 50 75 62 | 6c 69 63 56 61 6c 69 64 |// gxPub|licValid|
|00003020| 61 74 69 6f 6e 20 77 69 | 6c 6c 20 63 68 65 63 6b |ation wi|ll check|
|00003030| 20 70 61 72 61 6d 65 74 | 65 72 73 20 74 6f 20 70 | paramet|ers to p|
|00003040| 75 62 6c 69 63 20 72 6f | 75 74 69 6e 65 73 2e 20 |ublic ro|utines. |
|00003050| 46 6f 72 20 61 64 64 69 | 74 69 6f 6e 61 6c 20 64 |For addi|tional d|
|00003060| 65 74 61 69 6c 73 0d 09 | 09 2f 2f 20 72 65 67 61 |etails..|.// rega|
|00003070| 72 64 69 6e 67 20 74 68 | 65 20 76 61 72 69 6f 75 |rding th|e variou|
|00003080| 73 20 6c 65 76 65 6c 73 | 20 6f 66 20 76 61 6c 69 |s levels| of vali|
|00003090| 64 61 74 69 6f 6e 2c 20 | 73 65 65 20 22 49 6e 73 |dation, |see "Ins|
|000030a0| 69 64 65 20 4d 61 63 69 | 6e 74 6f 73 68 3a 20 51 |ide Maci|ntosh: Q|
|000030b0| 75 69 63 6b 44 72 61 77 | 20 47 58 0d 09 09 2f 2f |uickDraw| GX...//|
|000030c0| 20 45 6e 76 69 72 6f 6e | 6d 65 6e 74 20 61 6e 64 | Environ|ment and|
|000030d0| 20 55 74 69 6c 74 69 65 | 73 2e 22 0d 09 0d 09 09 | Utiltie|s.".....|
|000030e0| 69 66 20 28 67 47 69 76 | 65 4d 65 56 61 6c 69 64 |if (gGiv|eMeValid|
|000030f0| 61 74 69 6f 6e 29 0d 09 | 09 09 47 58 53 65 74 56 |ation)..|..GXSetV|
|00003100| 61 6c 69 64 61 74 69 6f | 6e 28 67 78 50 75 62 6c |alidatio|n(gxPubl|
|00003110| 69 63 56 61 6c 69 64 61 | 74 69 6f 6e 29 3b 20 0d |icValida|tion); .|
|00003120| 09 0d 09 09 2f 2f 20 49 | 6e 69 74 69 61 6c 69 7a |....// I|nitializ|
|00003130| 65 20 74 68 65 20 6e 65 | 77 20 67 72 61 70 68 69 |e the ne|w graphi|
|00003140| 63 73 20 61 6e 64 20 70 | 72 69 6e 74 69 6e 67 20 |cs and p|rinting |
|00003150| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 73 2e 0d 09 0d |environm|ents....|
|00003160| 09 09 69 66 20 28 20 47 | 58 47 65 74 47 72 61 70 |..if ( G|XGetGrap|
|00003170| 68 69 63 73 45 72 72 6f | 72 28 20 6e 69 6c 20 29 |hicsErro|r( nil )|
|00003180| 20 21 3d 20 6f 75 74 5f | 6f 66 5f 6d 65 6d 6f 72 | != out_|of_memor|
|00003190| 79 20 29 20 0d 09 09 7b | 0d 09 09 09 4f 53 45 72 |y ) ...{|....OSEr|
|000031a0| 72 09 65 72 72 3b 0d 09 | 09 09 0d 09 09 09 47 58 |r.err;..|......GX|
|000031b0| 45 6e 74 65 72 47 72 61 | 70 68 69 63 73 28 29 3b |EnterGra|phics();|
|000031c0| 0d 09 09 09 65 72 72 20 | 3d 20 47 58 49 6e 69 74 |....err |= GXInit|
|000031d0| 50 72 69 6e 74 69 6e 67 | 28 29 3b 0d 09 09 0d 09 |Printing|();.....|
|000031e0| 09 09 2f 2f 20 49 6e 69 | 74 69 61 6c 69 7a 65 20 |..// Ini|tialize |
|000031f0| 74 68 65 20 6f 74 68 65 | 72 20 6d 61 6e 61 67 65 |the othe|r manage|
|00003200| 72 73 2c 20 69 66 20 6e | 6f 20 65 72 72 6f 72 73 |rs, if n|o errors|
|00003210| 20 6f 63 63 75 72 72 65 | 64 2e 0d 09 09 09 69 66 | occurre|d.....if|
|00003220| 20 28 20 65 72 72 20 3d | 3d 20 6e 6f 45 72 72 20 | ( err =|= noErr |
|00003230| 29 0d 09 09 09 7b 0d 09 | 09 09 09 49 6e 69 74 43 |)....{..|...InitC|
|00003240| 6f 6d 6d 6f 6e 43 6f 6c | 6f 72 73 28 29 3b 0d 09 |ommonCol|ors();..|
|00003250| 09 09 09 2f 2f 20 49 6e | 69 74 69 61 6c 69 7a 65 |...// In|itialize|
|00003260| 20 6f 75 72 20 70 72 69 | 6e 74 69 6e 67 20 65 76 | our pri|nting ev|
|00003270| 65 6e 74 20 6f 76 65 72 | 72 69 64 65 20 55 50 50 |ent over|ride UPP|
|00003280| 0d 09 09 09 09 67 4f 75 | 72 50 72 69 6e 74 69 6e |.....gOu|rPrintin|
|00003290| 67 4f 76 65 72 72 69 64 | 65 55 50 50 20 3d 20 4e |gOverrid|eUPP = N|
|000032a0| 65 77 47 58 50 72 69 6e | 74 69 6e 67 45 76 65 6e |ewGXPrin|tingEven|
|000032b0| 74 50 72 6f 63 28 4d 79 | 47 58 50 72 69 6e 74 69 |tProc(My|GXPrinti|
|000032c0| 6e 67 45 76 65 6e 74 4f | 76 65 72 72 69 64 65 29 |ngEventO|verride)|
|000032d0| 3b 0d 09 09 09 09 2f 2f | 20 73 75 63 63 65 73 73 |;.....//| success|
|000032e0| 21 0d 09 09 09 09 72 65 | 73 75 6c 74 20 3d 20 74 |!.....re|sult = t|
|000032f0| 72 75 65 3b 0d 09 09 09 | 7d 0d 09 09 7d 0d 09 7d |rue;....|}...}..}|
|00003300| 0d 09 72 65 74 75 72 6e | 20 72 65 73 75 6c 74 3b |..return| result;|
|00003310| 0d 7d 0d 09 0d 0d 76 6f | 69 64 20 54 65 61 72 44 |.}....vo|id TearD|
|00003320| 6f 77 6e 47 58 28 76 6f | 69 64 29 0d 7b 0d 09 44 |ownGX(vo|id).{..D|
|00003330| 69 73 70 6f 73 65 43 6f | 6d 6d 6f 6e 43 6f 6c 6f |isposeCo|mmonColo|
|00003340| 72 73 28 29 3b 0d 09 47 | 58 45 78 69 74 50 72 69 |rs();..G|XExitPri|
|00003350| 6e 74 69 6e 67 28 29 3b | 09 2f 2f 20 43 6c 6f 73 |nting();|.// Clos|
|00003360| 65 20 74 68 65 20 6e 65 | 77 20 70 72 69 6e 74 69 |e the ne|w printi|
|00003370| 6e 67 20 6d 67 72 2e 20 | 0d 09 47 58 45 78 69 74 |ng mgr. |..GXExit|
|00003380| 47 72 61 70 68 69 63 73 | 28 29 3b 09 09 2f 2f 20 |Graphics|();..// |
|00003390| 44 65 61 6c 6c 6f 63 61 | 74 65 20 61 6c 6c 20 6f |Dealloca|te all o|
|000033a0| 66 20 74 68 65 20 64 65 | 66 61 75 6c 74 20 73 74 |f the de|fault st|
|000033b0| 72 75 63 74 75 72 65 73 | 0d 09 47 58 44 69 73 70 |ructures|..GXDisp|
|000033c0| 6f 73 65 47 72 61 70 68 | 69 63 73 43 6c 69 65 6e |oseGraph|icsClien|
|000033d0| 74 28 67 47 72 61 70 68 | 69 63 73 43 6c 69 65 6e |t(gGraph|icsClien|
|000033e0| 74 29 3b 0d 09 44 69 73 | 70 6f 73 65 52 6f 75 74 |t);..Dis|poseRout|
|000033f0| 69 6e 65 44 65 73 63 72 | 69 70 74 6f 72 28 67 4f |ineDescr|iptor(gO|
|00003400| 75 72 50 72 69 6e 74 69 | 6e 67 4f 76 65 72 72 69 |urPrinti|ngOverri|
|00003410| 64 65 55 50 50 29 3b 0d | 7d 0d 0d 0d 00 00 00 00 |deUPP);.|}.......|
|00003420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003480| 00 00 01 00 00 00 03 7c | 00 00 02 7c 00 00 00 66 |.......||...|...f|
|00003490| 2f 0d 09 09 67 42 72 75 | 73 68 53 74 75 66 66 2e |/...gBru|shStuff.|
|000034a0| 73 74 6f 72 61 67 65 20 | 3d 20 28 6c 6f 6e 67 29 |storage |= (long)|
|000034b0| 12 50 61 70 65 72 4a 75 | 67 67 6c 69 6e 67 41 70 |.PaperJu|gglingAp|
|000034c0| 70 2e 63 72 02 00 00 00 | 54 45 58 54 4d 4d 43 43 |p.cr....|TEXTMMCC|
|000034d0| 00 00 54 45 58 54 4d 4d | 43 43 01 00 01 6c 00 00 |..TEXTMM|CC...l..|
|000034e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034f0| 00 00 a5 9c 43 50 00 00 | 33 9c 00 00 03 e2 69 64 |....CP..|3.....id|
|00003500| 29 3b 0d 0d 2f 2a 20 45 | 76 65 6e 74 73 20 2a 2f |);../* E|vents */|
|00003510| 0d 76 6f 69 64 20 09 44 | 6f 41 70 70 55 70 64 61 |.void .D|oAppUpda|
|00003520| 74 65 28 45 76 65 6e 74 | 52 65 63 6f 72 64 20 2a |te(Event|Record *|
|00003530| 45 76 65 6e 74 29 3b 0d | 76 6f 69 64 20 09 44 6f |Event);.|void .Do|
|00003540| 41 70 70 49 64 6c 65 28 | 45 76 65 6e 74 52 65 63 |AppIdle(|EventRec|
|00003550| 6f 72 64 20 2a 45 76 65 | 6e 74 29 3b 0d 76 6f 69 |ord *Eve|nt);.voi|
|00003560| 64 20 09 44 6f 41 70 70 | 43 6c 69 63 6b 28 50 6f |d .DoApp|Click(Po|
|00003570| 69 6e 74 20 74 68 65 50 | 74 2c 20 57 69 6e 64 6f |int theP|t, Windo|
|00003580| 00 00 02 18 00 17 00 00 | 02 6a 00 00 02 71 0d 00 |........|.j...q..|
|00003590| 00 00 31 20 41 70 70 49 | 6e 69 74 00 00 00 04 a7 |..1 AppI|nit.....|
|000035a0| 00 00 04 b2 11 00 00 00 | 32 20 41 70 70 41 63 74 |........|2 AppAct|
|000035b0| 69 76 61 74 65 00 00 00 | 07 54 00 00 07 5d 0f 00 |ivate...|.T...]..|
|000035c0| 00 00 33 20 41 70 70 55 | 70 64 61 74 65 00 00 00 |..3 AppU|pdate...|
|000035d0| 09 b4 00 00 09 bb 0d 00 | 00 00 34 20 41 70 70 49 |........|..4 AppI|
|000035e0| 64 6c 65 00 00 00 0a 97 | 00 00 0a 9f 0d 00 00 00 |dle.....|........|
|000035f0| 35 20 41 70 70 43 6c 69 | 63 6b 00 00 0f 7a 00 00 |5 AppCli|ck...z..|
|00003600| 0f 87 13 00 00 00 36 20 | 41 70 70 47 72 6f 77 57 |......6 |AppGrowW|
|00003610| 69 6e 64 6f 77 00 00 00 | 18 67 00 00 18 74 13 00 |indow...|.g...t..|
|00003620| 00 00 37 20 41 70 70 5a | 6f 6f 6d 57 69 6e 64 6f |..7 AppZ|oomWindo|
|00003630| 77 00 00 00 1c c4 00 00 | 1c d2 13 00 00 00 38 20 |w.......|......8 |
|00003640| 41 70 70 41 64 6a 75 73 | 74 4d 65 6e 75 73 00 00 |AppAdjus|tMenus..|
|00003650| 24 77 00 00 24 7e 0d 00 | 00 00 39 20 41 70 70 4d |$w..$~..|..9 AppM|
|00003660| 65 6e 75 00 00 00 24 df | 00 00 24 e5 0b 00 00 31 |enu...$.|..$....1|
|00003670| 30 20 41 70 70 4e 65 77 | 00 00 27 3e 00 00 27 45 |0 AppNew|..'>..'E|
|00003680| 0d 00 00 31 31 20 41 70 | 70 4f 70 65 6e 00 00 00 |...11 Ap|pOpen...|
|00003690| 2a 29 00 00 2a 31 0d 00 | 00 31 32 20 41 70 70 43 |*)..*1..|.12 AppC|
|000036a0| 6c 6f 73 65 00 00 2c 86 | 00 00 2c 8d 0d 00 00 31 |lose..,.|..,....1|
|000036b0| 33 20 41 70 70 53 61 76 | 65 00 00 00 31 68 00 00 |3 AppSav|e...1h..|
|000036c0| 31 71 0f 00 00 31 34 20 | 41 70 70 53 61 76 65 41 |1q...14 |AppSaveA|
|000036d0| 73 00 00 00 36 ac 00 00 | 36 b8 11 00 00 31 35 20 |s...6...|6....15 |
|000036e0| 41 70 70 50 61 67 65 53 | 65 74 75 70 00 00 38 27 |AppPageS|etup..8'|
|000036f0| 00 00 38 2f 0d 00 00 31 | 36 20 41 70 70 50 72 69 |..8/...1|6 AppPri|
|00003700| 6e 74 00 00 39 71 00 00 | 39 78 0d 00 00 31 37 20 |nt..9q..|9x...17 |
|00003710| 41 70 70 55 6e 64 6f 00 | 00 00 3b 7c 00 00 3b 82 |AppUndo.|..;|..;.|
|00003720| 0b 00 00 31 38 20 41 70 | 70 43 75 74 00 00 3d f7 |...18 Ap|pCut..=.|
|00003730| 00 00 3d fe 0d 00 00 31 | 39 20 41 70 70 43 6f 70 |..=....1|9 AppCop|
|00003740| 79 00 00 00 41 d2 00 00 | 41 da 0d 00 00 32 30 20 |y...A...|A....20 |
|00003750| 41 70 70 50 61 73 74 65 | 00 00 46 9b 00 00 46 a3 |AppPaste|..F...F.|
|00003760| 0d 00 00 32 31 20 41 70 | 70 43 6c 65 61 72 00 00 |...21 Ap|pClear..|
|00003770| 49 13 00 00 49 1a 0d 00 | 00 32 32 20 41 70 70 51 |I...I...|.22 AppQ|
|00003780| 75 69 74 00 00 00 49 ed | 00 00 49 f7 0f 00 00 32 |uit...I.|..I....2|
|00003790| 33 20 41 70 70 43 6c 65 | 61 6e 55 70 00 00 00 08 |3 AppCle|anUp....|
|000037a0| 00 38 00 14 01 d6 02 40 | 00 00 00 48 00 09 4d 6f |.8.....@|...H..Mo|
|000037b0| 6e 61 63 6f 00 00 00 00 | 00 00 00 00 00 00 00 00 |naco....|........|
|000037c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 03 |........|........|
|000037d0| 00 04 00 3e 00 04 01 cd | 02 63 00 3e 00 04 01 cd |...>....|.c.>....|
|000037e0| 02 63 ab ba e8 d5 00 00 | 11 3d 00 00 11 3d 00 00 |.c......|.=...=..|
|000037f0| 10 2d 01 00 00 00 00 04 | 00 01 00 01 00 00 01 00 |.-......|........|
|00003800| 00 00 03 7c 00 00 02 7c | 00 00 00 66 00 7b 66 28 |...|...||...f.{f(|
|00003810| 20 52 00 00 00 1c 00 66 | 00 02 4d 50 53 52 00 01 | R.....f|..MPSR..|
|00003820| 00 1a 52 45 43 54 00 00 | 00 32 4d 57 42 42 00 00 |..RECT..|.2MWBB..|
|00003830| 00 3e 03 ef ff ff 00 00 | 00 00 00 00 00 00 03 ed |.>......|........|
|00003840| ff ff 00 00 02 28 00 00 | 00 00 00 00 ff ff 00 00 |.....(..|........|
|00003850| 02 1c 00 00 00 00 03 f0 | ff ff 00 00 02 74 00 00 |........|.....t..|
|00003860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+